1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.to;
20
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23
24 public class SAML2SPEntityTO extends SAML2EntityTO {
25
26 private static final long serialVersionUID = 6215073386484048953L;
27
28 public static class Builder extends SAML2EntityTO.Builder<SAML2SPEntityTO, Builder> {
29
30 @Override
31 protected SAML2SPEntityTO newInstance() {
32 return new SAML2SPEntityTO();
33 }
34
35 public Builder keystore(final String keystore) {
36 getInstance().setKeystore(keystore);
37 return this;
38 }
39
40 public Builder metadata(final String metadata) {
41 getInstance().setMetadata(metadata);
42 return this;
43 }
44 }
45
46 private String keystore;
47
48 private String metadata;
49
50 public String getKeystore() {
51 return keystore;
52 }
53
54 public void setKeystore(final String keystore) {
55 this.keystore = keystore;
56 }
57
58 public String getMetadata() {
59 return metadata;
60 }
61
62 public void setMetadata(final String metadata) {
63 this.metadata = metadata;
64 }
65
66 @Override
67 public int hashCode() {
68 return new HashCodeBuilder().
69 appendSuper(super.hashCode()).
70 append(keystore).
71 append(metadata).
72 build();
73 }
74
75 @Override
76 public boolean equals(final Object obj) {
77 if (this == obj) {
78 return true;
79 }
80 if (obj == null) {
81 return false;
82 }
83 if (getClass() != obj.getClass()) {
84 return false;
85 }
86 SAML2SPEntityTO other = (SAML2SPEntityTO) obj;
87 return new EqualsBuilder().
88 appendSuper(super.equals(obj)).
89 append(keystore, other.keystore).
90 append(metadata, other.metadata).
91 build();
92 }
93 }