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 java.time.OffsetDateTime;
22 import org.apache.commons.lang3.builder.EqualsBuilder;
23 import org.apache.commons.lang3.builder.HashCodeBuilder;
24
25 public class AccessTokenTO implements EntityTO {
26
27 private static final long serialVersionUID = 6577639976115661357L;
28
29 private String key;
30
31 private String body;
32
33 private OffsetDateTime expirationTime;
34
35 private String owner;
36
37 @Override
38 public String getKey() {
39 return key;
40 }
41
42 @Override
43 public void setKey(final String key) {
44 this.key = key;
45 }
46
47 public String getBody() {
48 return body;
49 }
50
51 public void setBody(final String body) {
52 this.body = body;
53 }
54
55 public OffsetDateTime getExpirationTime() {
56 return expirationTime;
57 }
58
59 public void setExpirationTime(final OffsetDateTime expirationTime) {
60 this.expirationTime = expirationTime;
61 }
62
63 public String getOwner() {
64 return owner;
65 }
66
67 public void setOwner(final String owner) {
68 this.owner = owner;
69 }
70
71 @Override
72 public boolean equals(final Object obj) {
73 if (this == obj) {
74 return true;
75 }
76 if (obj == null) {
77 return false;
78 }
79 if (getClass() != obj.getClass()) {
80 return false;
81 }
82 AccessTokenTO other = (AccessTokenTO) obj;
83 return new EqualsBuilder().
84 append(key, other.key).
85 append(body, other.body).
86 append(expirationTime, other.expirationTime).
87 append(owner, other.owner).
88 build();
89 }
90
91 @Override
92 public int hashCode() {
93 return new HashCodeBuilder().
94 append(key).
95 append(body).
96 append(expirationTime).
97 append(owner).
98 build();
99 }
100 }