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.ZonedDateTime;
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 MfaTrustedDevice implements BaseBean {
28
29 private static final long serialVersionUID = 5120423450725182470L;
30
31 private long id;
32
33 private String name;
34
35 private String deviceFingerprint;
36
37 private String recordKey;
38
39 private ZonedDateTime recordDate;
40
41 private ZonedDateTime expirationDate;
42
43 public long getId() {
44 return id;
45 }
46
47 public void setId(final long id) {
48 this.id = id;
49 }
50
51 public String getName() {
52 return name;
53 }
54
55 public void setName(final String name) {
56 this.name = name;
57 }
58
59 public String getDeviceFingerprint() {
60 return deviceFingerprint;
61 }
62
63 public void setDeviceFingerprint(final String deviceFingerprint) {
64 this.deviceFingerprint = deviceFingerprint;
65 }
66
67 public ZonedDateTime getRecordDate() {
68 return recordDate;
69 }
70
71 public void setRecordDate(final ZonedDateTime recordDate) {
72 this.recordDate = recordDate;
73 }
74
75 public String getRecordKey() {
76 return recordKey;
77 }
78
79 public void setRecordKey(final String recordKey) {
80 this.recordKey = recordKey;
81 }
82
83 public ZonedDateTime getExpirationDate() {
84 return expirationDate;
85 }
86
87 public void setExpirationDate(final ZonedDateTime expirationDate) {
88 this.expirationDate = expirationDate;
89 }
90
91 @Override
92 public int hashCode() {
93 return new HashCodeBuilder()
94 .append(id)
95 .append(name)
96 .append(deviceFingerprint)
97 .append(recordDate)
98 .append(recordKey)
99 .append(expirationDate)
100 .toHashCode();
101 }
102
103 @Override
104 public boolean equals(final Object obj) {
105 if (obj == null) {
106 return false;
107 }
108 if (obj == this) {
109 return true;
110 }
111 if (obj.getClass() != getClass()) {
112 return false;
113 }
114 MfaTrustedDevice other = (MfaTrustedDevice) obj;
115 return new EqualsBuilder()
116 .append(this.id, other.id)
117 .append(this.name, other.name)
118 .append(this.deviceFingerprint, other.deviceFingerprint)
119 .append(this.recordDate, other.recordDate)
120 .append(this.recordKey, other.recordKey)
121 .append(this.expirationDate, other.expirationDate)
122 .isEquals();
123 }
124
125 @Override
126 public String toString() {
127 return new ToStringBuilder(this)
128 .append("id", id)
129 .append("name", name)
130 .append("deviceFingerprint", deviceFingerprint)
131 .append("recordDate", recordDate)
132 .append("recordKey", recordKey)
133 .append("expirationDate", expirationDate)
134 .toString();
135 }
136 }