1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.amber.oauth2.common.domain.credentials;
22
23 import java.lang.Long;import java.lang.Object;import java.lang.Override;import java.lang.String;
24
25
26
27
28 public class BasicCredentials implements Credentials {
29
30
31 private String clientId;
32 private String clientSecret;
33 private Long issuedAt;
34 private Long expiresIn;
35
36 BasicCredentials() {
37
38 }
39
40 public BasicCredentials(String clientId, String clientSecret, Long issuedAt, Long expiresIn) {
41 this.clientId = clientId;
42 this.clientSecret = clientSecret;
43 this.issuedAt = issuedAt;
44 this.expiresIn = expiresIn;
45 }
46
47 @Override
48 public String getClientId() {
49 return clientId;
50 }
51
52 @Override
53 public String getClientSecret() {
54 return clientSecret;
55 }
56
57 @Override
58 public Long getIssuedAt() {
59 return issuedAt;
60 }
61
62 @Override
63 public Long getExpiresIn() {
64 return expiresIn;
65 }
66
67 public void setClientId(String clientId) {
68 this.clientId = clientId;
69 }
70
71 public void setClientSecret(String clientSecret) {
72 this.clientSecret = clientSecret;
73 }
74
75 public void setIssuedAt(Long issuedAt) {
76 this.issuedAt = issuedAt;
77 }
78
79 public void setExpiresIn(Long expiresIn) {
80 this.expiresIn = expiresIn;
81 }
82
83 @Override
84 public boolean equals(Object o) {
85 if (this == o) {
86 return true;
87 }
88 if (o == null || getClass() != o.getClass()) {
89 return false;
90 }
91
92 BasicCredentials that = (BasicCredentials)o;
93
94 if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null) {
95 return false;
96 }
97 if (clientSecret != null ? !clientSecret.equals(that.clientSecret) : that.clientSecret != null) {
98 return false;
99 }
100 if (expiresIn != null ? !expiresIn.equals(that.expiresIn) : that.expiresIn != null) {
101 return false;
102 }
103 if (issuedAt != null ? !issuedAt.equals(that.issuedAt) : that.issuedAt != null) {
104 return false;
105 }
106
107 return true;
108 }
109
110 @Override
111 public int hashCode() {
112 int result = clientId != null ? clientId.hashCode() : 0;
113 result = 31 * result + (clientSecret != null ? clientSecret.hashCode() : 0);
114 result = 31 * result + (issuedAt != null ? issuedAt.hashCode() : 0);
115 result = 31 * result + (expiresIn != null ? expiresIn.hashCode() : 0);
116 return result;
117 }
118 }