1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.api.ldap.aci.protectedItem;
21
22
23 import org.apache.directory.api.ldap.model.schema.AttributeType;
24
25
26
27
28
29 public class RestrictedByElem
30 {
31
32 private AttributeType attributeType;
33
34
35 private AttributeType valuesIn;
36
37
38
39
40
41
42
43
44 public RestrictedByElem( AttributeType attributeType, AttributeType valuesIn )
45 {
46 this.attributeType = attributeType;
47 this.valuesIn = valuesIn;
48 }
49
50
51
52
53
54
55
56 public AttributeType getAttributeType()
57 {
58 return attributeType;
59 }
60
61
62
63
64
65
66
67
68 public AttributeType getValuesIn()
69 {
70 return valuesIn;
71 }
72
73
74
75
76
77 @Override
78 public int hashCode()
79 {
80 int hash = 37;
81 hash = hash * 17 + attributeType.hashCode();
82 hash = hash * 17 + valuesIn.hashCode();
83 return hash;
84 }
85
86
87
88
89
90 @Override
91 public boolean equals( Object o )
92 {
93 if ( o == null )
94 {
95 return false;
96 }
97
98 if ( this == o )
99 {
100 return true;
101 }
102
103 if ( o instanceof RestrictedByElem )
104 {
105 RestrictedByElem that = ( RestrictedByElem ) o;
106 if ( this.attributeType == null )
107 {
108 if ( that.attributeType == null )
109 {
110 if ( this.valuesIn == null )
111 {
112 return that.valuesIn == null;
113 }
114 else
115 {
116 return this.valuesIn.equals( that.valuesIn );
117 }
118 }
119 return false;
120 }
121 else
122 {
123 if ( this.attributeType.equals( that.attributeType ) )
124 {
125 if ( this.valuesIn == null )
126 {
127 return that.valuesIn == null;
128 }
129 else
130 {
131 return this.valuesIn.equals( that.valuesIn );
132 }
133 }
134 return false;
135 }
136 }
137 return false;
138 }
139
140
141
142
143
144 @Override
145 public String toString()
146 {
147 return "{ type " + attributeType.getName() + ", valuesIn " + valuesIn.getName() + " }";
148 }
149 }