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 import java.io.Serializable;
23
24
25
26
27
28
29
30
31 class RevisionName extends Tuple<Long, String> implements Serializable
32 {
33
34
35
36 protected RevisionName()
37 {
38 }
39
40
41
42
43
44
45
46 RevisionName( long revision, String name )
47 {
48 super( revision, name );
49 }
50
51
52
53
54
55 long getRevision()
56 {
57 return getKey();
58 }
59
60
61
62
63
64 void setRevision( long revision )
65 {
66 setKey( revision );
67 }
68
69
70
71
72
73 String getName()
74 {
75 return getValue();
76 }
77
78
79
80
81
82 void setName( String name )
83 {
84 setValue( name );
85 }
86
87
88
89
90
91 public boolean equals( Object that )
92 {
93 if ( this == that )
94 {
95 return true;
96 }
97
98 if ( !( that instanceof RevisionName ) )
99 {
100 return false;
101 }
102
103 RevisionName revisionName = ( RevisionName ) that;
104
105 if ( getRevision() != revisionName.getRevision() )
106 {
107 return false;
108 }
109
110 if ( getName() == null )
111 {
112 return revisionName.getName() == null;
113 }
114
115 return ( getName().equals( revisionName.getName() ) );
116
117 }
118
119
120 @Override
121 public int hashCode()
122 {
123 final int prime = 31;
124 int result = 1;
125 result = prime * result + ( ( getName() == null ) ? 0 : getName().hashCode() );
126 result = prime * result + ( int ) ( getRevision() ^ ( getRevision() >>> 32 ) );
127 return result;
128 }
129
130
131
132
133
134 public String toString()
135 {
136 return "[" + getRevision() + ":" + getName() + "]";
137 }
138 }