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.wa;
20
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23 import org.apache.commons.lang3.builder.ToStringBuilder;
24 import org.apache.syncope.common.lib.BaseBean;
25
26 public class WebAuthnDeviceCredential implements BaseBean {
27
28 private static final long serialVersionUID = 1185073386484048953L;
29
30 public static class Builder {
31
32 private final WebAuthnDeviceCredential instance = new WebAuthnDeviceCredential();
33
34 public WebAuthnDeviceCredential.Builder json(final String json) {
35 instance.setJson(json);
36 return this;
37 }
38
39 public WebAuthnDeviceCredential.Builder identifier(final String identifier) {
40 instance.setIdentifier(identifier);
41 return this;
42 }
43
44 public WebAuthnDeviceCredential build() {
45 return instance;
46 }
47 }
48
49 private String json;
50
51 private String identifier;
52
53 public String getIdentifier() {
54 return identifier;
55 }
56
57 public void setIdentifier(final String identifier) {
58 this.identifier = identifier;
59 }
60
61 public String getJson() {
62 return json;
63 }
64
65 public void setJson(final String json) {
66 this.json = json;
67 }
68
69 @Override
70 public int hashCode() {
71 return new HashCodeBuilder()
72 .append(json)
73 .append(identifier)
74 .toHashCode();
75 }
76
77 @Override
78 public boolean equals(final Object obj) {
79 if (obj == null) {
80 return false;
81 }
82 if (obj == this) {
83 return true;
84 }
85 if (obj.getClass() != getClass()) {
86 return false;
87 }
88 WebAuthnDeviceCredential other = (WebAuthnDeviceCredential) obj;
89 return new EqualsBuilder()
90 .append(this.json, other.json)
91 .append(this.identifier, other.identifier)
92 .isEquals();
93 }
94
95 @Override
96 public String toString() {
97 return new ToStringBuilder(this)
98 .append("records", json)
99 .append("identifier", identifier)
100 .toString();
101 }
102 }