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
29 public class AttributeStatementBean {
30 private SubjectBean subject;
31 private List<AttributeBean> attributeBeans;
32
33
34
35
36 public AttributeStatementBean() {
37 attributeBeans = new ArrayList<>();
38 }
39
40
41
42
43
44
45 public AttributeStatementBean(
46 SubjectBean subject,
47 List<AttributeBean> attributeBeans
48 ) {
49 this.subject = subject;
50 this.attributeBeans = attributeBeans;
51 }
52
53
54
55
56
57
58 public List<AttributeBean> getSamlAttributes() {
59 return attributeBeans;
60 }
61
62
63
64
65
66
67
68 public void setSamlAttributes(List<AttributeBean> attributeBeans) {
69 this.attributeBeans = attributeBeans;
70 }
71
72
73
74
75
76 public SubjectBean getSubject() {
77 return subject;
78 }
79
80
81
82
83
84 public void setSubject(SubjectBean subject) {
85 this.subject = subject;
86 }
87
88 @Override
89 public boolean equals(Object o) {
90 if (this == o) {
91 return true;
92 }
93 if (!(o instanceof AttributeStatementBean)) {
94 return false;
95 }
96
97 AttributeStatementBean that = (AttributeStatementBean) o;
98
99 if (attributeBeans == null && that.attributeBeans != null) {
100 return false;
101 } else if (attributeBeans != null && !attributeBeans.equals(that.attributeBeans)) {
102 return false;
103 }
104
105 if (subject == null && that.subject != null) {
106 return false;
107 } else if (subject != null && !subject.equals(that.subject)) {
108 return false;
109 }
110
111 return true;
112 }
113
114 @Override
115 public int hashCode() {
116 int result = subject != null ? subject.hashCode() : 0;
117 result = 31 * result + (attributeBeans != null ? attributeBeans.hashCode() : 0);
118 return result;
119 }
120 }