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.time.Instant;
23 import java.util.Date;
24
25
26
27
28
29
30
31
32 public class DelegateBean {
33 private Instant delegationInstant;
34 private String confirmationMethod;
35 private NameIDBean nameIDBean;
36
37 public Instant getDelegationInstant() {
38 return delegationInstant;
39 }
40
41 public void setDelegationInstant(Instant delegationInstant) {
42 if (delegationInstant != null) {
43 this.delegationInstant = Date.from(delegationInstant).toInstant();
44 } else {
45 this.delegationInstant = null;
46 }
47 }
48
49 public String getConfirmationMethod() {
50 return confirmationMethod;
51 }
52
53 public void setConfirmationMethod(String confirmationMethod) {
54 this.confirmationMethod = confirmationMethod;
55 }
56
57 public NameIDBean getNameIDBean() {
58 return nameIDBean;
59 }
60
61 public void setNameIDBean(NameIDBean nameIDBean) {
62 this.nameIDBean = nameIDBean;
63 }
64
65
66
67
68
69
70
71 @Override
72 public boolean equals(Object o) {
73 if (this == o) {
74 return true;
75 }
76 if (!(o instanceof DelegateBean)) {
77 return false;
78 }
79
80 DelegateBean that = (DelegateBean) o;
81
82 if (delegationInstant == null && that.delegationInstant != null) {
83 return false;
84 } else if (delegationInstant != null && !delegationInstant.equals(that.delegationInstant)) {
85 return false;
86 }
87
88 if (confirmationMethod == null && that.confirmationMethod != null) {
89 return false;
90 } else if (confirmationMethod != null && !confirmationMethod.equals(that.confirmationMethod)) {
91 return false;
92 }
93
94 if (nameIDBean == null && that.nameIDBean != null) {
95 return false;
96 } else if (nameIDBean != null && !nameIDBean.equals(that.nameIDBean)) {
97 return false;
98 }
99
100 return true;
101 }
102
103
104
105
106 @Override
107 public int hashCode() {
108 int result = 0;
109 if (delegationInstant != null) {
110 result = 31 * result + delegationInstant.hashCode();
111 }
112 if (confirmationMethod != null) {
113 result = 31 * result + confirmationMethod.hashCode();
114 }
115 if (nameIDBean != null) {
116 result = 31 * result + nameIDBean.hashCode();
117 }
118 return result;
119 }
120
121 }