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 MaxValueCountElem
30 {
31
32 private AttributeType attributeType;
33
34
35 private int maxCount;
36
37
38
39
40
41
42
43
44
45 public MaxValueCountElem( AttributeType attributeType, int maxCount )
46 {
47 this.attributeType = attributeType;
48 this.maxCount = maxCount;
49 }
50
51
52
53
54
55
56
57 public AttributeType getAttributeType()
58 {
59 return attributeType;
60 }
61
62
63
64
65
66
67
68 public int getMaxCount()
69 {
70 return maxCount;
71 }
72
73
74
75
76
77 @Override
78 public int hashCode()
79 {
80 int hash = 37;
81 hash = hash * 17 + maxCount;
82 hash = hash * 17 + attributeType.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 MaxValueCountElem )
104 {
105 MaxValueCountElem that = ( MaxValueCountElem ) o;
106 if ( this.maxCount == that.maxCount )
107 {
108 if ( this.attributeType == null )
109 {
110 return that.attributeType == null;
111 }
112 else
113 {
114 return this.attributeType.equals( that.attributeType );
115 }
116 }
117 }
118 return false;
119 }
120
121
122
123
124
125 @Override
126 public String toString()
127 {
128 return "{ type " + attributeType.getName() + ", maxCount " + maxCount + " }";
129 }
130 }