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