1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.wss4j.common.saml.bean;
21
22 import java.util.List;
23 import java.util.ArrayList;
24
25
26
27
28 public class AttributeBean {
29 private String simpleName;
30 private String qualifiedName;
31 private String nameFormat;
32 private List<Object> attributeValues;
33
34
35
36
37 public AttributeBean() {
38 attributeValues = new ArrayList<>();
39 }
40
41
42
43
44
45
46
47
48 public AttributeBean(String simpleName, String qualifiedName, List<Object> attributeValues) {
49 this.simpleName = simpleName;
50 this.qualifiedName = qualifiedName;
51 this.attributeValues = attributeValues;
52 }
53
54
55
56
57
58
59 public String getSimpleName() {
60 return simpleName;
61 }
62
63
64
65
66
67
68 public void setSimpleName(String simpleName) {
69 this.simpleName = simpleName;
70 }
71
72
73
74
75
76
77 public String getNameFormat() {
78 return nameFormat;
79 }
80
81
82
83
84
85
86 public void setNameFormat(String nameFormat) {
87 this.nameFormat = nameFormat;
88 }
89
90
91
92
93
94
95 public String getQualifiedName() {
96 return qualifiedName;
97 }
98
99
100
101
102
103
104 public void setQualifiedName(String qualifiedName) {
105 this.qualifiedName = qualifiedName;
106 }
107
108
109
110
111
112
113 public List<Object> getAttributeValues() {
114 return attributeValues;
115 }
116
117
118
119
120
121
122 public void setAttributeValues(List<Object> attributeValues) {
123 this.attributeValues = attributeValues;
124 }
125
126 public void addAttributeValue(Object attributeValue) {
127 if (attributeValues == null) {
128 attributeValues = new ArrayList<>();
129 }
130 attributeValues.add(attributeValue);
131 }
132
133 @Override
134 public boolean equals(Object o) {
135 if (this == o) {
136 return true;
137 }
138 if (!(o instanceof AttributeBean)) {
139 return false;
140 }
141
142 AttributeBean that = (AttributeBean) o;
143
144 if (attributeValues == null && that.attributeValues != null) {
145 return false;
146 } else if (attributeValues != null && !attributeValues.equals(that.attributeValues)) {
147 return false;
148 }
149
150 if (qualifiedName == null && that.qualifiedName != null) {
151 return false;
152 } else if (qualifiedName != null && !qualifiedName.equals(that.qualifiedName)) {
153 return false;
154 }
155
156 if (nameFormat == null && that.nameFormat != null) {
157 return false;
158 } else if (nameFormat != null && !nameFormat.equals(that.nameFormat)) {
159 return false;
160 }
161
162 if (simpleName == null && that.simpleName != null) {
163 return false;
164 } else if (simpleName != null && !simpleName.equals(that.simpleName)) {
165 return false;
166 }
167
168 return true;
169 }
170
171 @Override
172 public int hashCode() {
173 int result = 0;
174 if (simpleName != null) {
175 result = 31 * result + simpleName.hashCode();
176 }
177 if (qualifiedName != null) {
178 result = 31 * result + qualifiedName.hashCode();
179 }
180 if (nameFormat != null) {
181 result = 31 * result + nameFormat.hashCode();
182 }
183 if (attributeValues != null) {
184 result = 31 * result + attributeValues.hashCode();
185 }
186 return result;
187 }
188 }