1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.mavibot.btree;
21
22
23
24
25
26
27
28
29 class NameRevision extends Tuple<String, Long>
30 {
31
32
33
34
35
36 NameRevision( String name, long revision )
37 {
38 super( name, revision );
39 }
40
41
42
43
44
45 long getRevision()
46 {
47 return getValue();
48 }
49
50
51
52
53
54 void setRevision( long revision )
55 {
56 setValue( revision );
57 }
58
59
60
61
62
63 String getName()
64 {
65 return getKey();
66 }
67
68
69
70
71
72 void setName( String name )
73 {
74 setKey( name );
75 }
76
77
78
79
80
81 public boolean equals( Object that )
82 {
83 if ( this == that )
84 {
85 return true;
86 }
87
88 if ( !( that instanceof NameRevision ) )
89 {
90 return false;
91 }
92
93 NameRevision revisionName = ( NameRevision ) that;
94
95 if ( getRevision() != revisionName.getRevision() )
96 {
97 return false;
98 }
99
100 if ( getName() == null )
101 {
102 return revisionName.getName() == null;
103 }
104
105 return ( getName().equals( revisionName.getName() ) );
106
107 }
108
109
110 @Override
111 public int hashCode()
112 {
113 final int prime = 31;
114 int result = 1;
115 result = prime * result + ( ( getName() == null ) ? 0 : getName().hashCode() );
116 result = prime * result + ( int ) ( getRevision() ^ ( getRevision() >>> 32 ) );
117 return result;
118 }
119
120
121
122
123
124 public String toString()
125 {
126 return "[" + getName() + ":" + getRevision() + "]";
127 }
128 }