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 java.time.OffsetDateTime;
22 import org.apache.commons.lang3.builder.EqualsBuilder;
23 import org.apache.commons.lang3.builder.HashCodeBuilder;
24 import org.apache.commons.lang3.builder.ToStringBuilder;
25 import org.apache.syncope.common.lib.BaseBean;
26
27 public class U2FDevice implements BaseBean {
28
29 private static final long serialVersionUID = 1185073386484048953L;
30
31 public static class Builder {
32
33 private final U2FDevice instance = new U2FDevice();
34
35 public U2FDevice.Builder issueDate(final OffsetDateTime issued) {
36 instance.setIssueDate(issued);
37 return this;
38 }
39
40 public U2FDevice.Builder record(final String record) {
41 instance.setRecord(record);
42 return this;
43 }
44
45 public U2FDevice.Builder id(final long id) {
46 instance.setId(id);
47 return this;
48 }
49
50 public U2FDevice build() {
51 return instance;
52 }
53 }
54
55 private long id;
56
57 private String record;
58
59 private OffsetDateTime issueDate;
60
61 public String getRecord() {
62 return record;
63 }
64
65 public void setRecord(final String record) {
66 this.record = record;
67 }
68
69 public long getId() {
70 return id;
71 }
72
73 public void setId(final long id) {
74 this.id = id;
75 }
76
77 public OffsetDateTime getIssueDate() {
78 return issueDate;
79 }
80
81 public void setIssueDate(final OffsetDateTime issueDate) {
82 this.issueDate = issueDate;
83 }
84
85 @Override
86 public int hashCode() {
87 return new HashCodeBuilder()
88 .append(record)
89 .append(id)
90 .append(issueDate)
91 .toHashCode();
92 }
93
94 @Override
95 public boolean equals(final Object obj) {
96 if (obj == null) {
97 return false;
98 }
99 if (obj == this) {
100 return true;
101 }
102 if (obj.getClass() != getClass()) {
103 return false;
104 }
105 U2FDevice other = (U2FDevice) obj;
106 return new EqualsBuilder()
107 .append(this.record, other.record)
108 .append(this.id, other.id)
109 .append(this.issueDate, other.issueDate)
110 .isEquals();
111 }
112
113 @Override
114 public String toString() {
115 return new ToStringBuilder(this)
116 .append("record", record)
117 .append("id", id)
118 .append("issueDate", issueDate)
119 .toString();
120 }
121 }