Skip to content

Commit b7e8677

Browse files
authored
Remove dependency on Lombok (#35)
1 parent 2bd472c commit b7e8677

12 files changed

Lines changed: 1100 additions & 29 deletions

File tree

duo-universal-sdk/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@
112112
<artifactId>converter-jackson</artifactId>
113113
<version>2.11.0</version>
114114
</dependency>
115-
<dependency>
116-
<groupId>org.projectlombok</groupId>
117-
<artifactId>lombok</artifactId>
118-
<version>1.18.20</version>
119-
<scope>provided</scope>
120-
</dependency>
121115
<dependency>
122116
<groupId>com.auth0</groupId>
123117
<artifactId>java-jwt</artifactId>
Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,98 @@
11
package com.duosecurity.model;
22

33
import java.io.Serializable;
4-
import lombok.Data;
4+
import java.util.Objects;
55

6-
@Data
76
public class AccessDevice implements Serializable {
87
private static final long serialVersionUID = -1130960392429229150L;
98

109
private String hostname;
1110
private String ip;
1211
private Location location;
12+
13+
14+
/**
15+
* Constructor with all properties.
16+
*
17+
* @param hostname hostname
18+
* @param ip ip
19+
* @param location location
20+
*/
21+
public AccessDevice(String hostname, String ip, Location location) {
22+
this.hostname = hostname;
23+
this.ip = ip;
24+
this.location = location;
25+
}
26+
27+
public AccessDevice() {
28+
}
29+
30+
public static long getSerialversionuid() {
31+
return serialVersionUID;
32+
}
33+
34+
public String getHostname() {
35+
return hostname;
36+
}
37+
38+
public void setHostname(String hostname) {
39+
this.hostname = hostname;
40+
}
41+
42+
public String getIp() {
43+
return ip;
44+
}
45+
46+
public void setIp(String ip) {
47+
this.ip = ip;
48+
}
49+
50+
public Location getLocation() {
51+
return location;
52+
}
53+
54+
public void setLocation(Location location) {
55+
this.location = location;
56+
}
57+
58+
@Override
59+
public String toString() {
60+
return "AccessDevice [hostname=" + hostname
61+
+ ", ip=" + ip
62+
+ ", location=" + location
63+
+ ", getHostname()=" + getHostname()
64+
+ ", getIp()=" + getIp()
65+
+ ", getLocation()=" + getLocation()
66+
+ ", hashCode()=" + hashCode()
67+
+ ", getClass()=" + getClass()
68+
+ ", toString()=" + super.toString()
69+
+ "]";
70+
}
71+
72+
@Override
73+
public boolean equals(Object obj) {
74+
if (this == obj) {
75+
return true;
76+
}
77+
if (obj == null) {
78+
return false;
79+
}
80+
if (getClass() != obj.getClass()) {
81+
return false;
82+
}
83+
AccessDevice other = (AccessDevice) obj;
84+
return Objects.equals(hostname, other.hostname)
85+
&& Objects.equals(ip, other.ip)
86+
&& Objects.equals(location, other.location);
87+
}
88+
89+
@Override
90+
public int hashCode() {
91+
final int prime = 31;
92+
int result = 1;
93+
result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
94+
result = prime * result + ((ip == null) ? 0 : ip.hashCode());
95+
result = prime * result + ((location == null) ? 0 : location.hashCode());
96+
return result;
97+
}
1398
}
Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,79 @@
11
package com.duosecurity.model;
22

33
import java.io.Serializable;
4-
import lombok.Data;
4+
import java.util.Objects;
55

6-
@Data
76
public class Application implements Serializable {
87
private static final long serialVersionUID = -5324896038503981781L;
98

109
private String key;
1110
private String name;
11+
12+
/**
13+
* Constructor with all properties.
14+
*
15+
* @param key key
16+
* @param name name
17+
*/
18+
public Application(String key, String name) {
19+
this.key = key;
20+
this.name = name;
21+
}
22+
23+
public Application() {
24+
}
25+
26+
public static long getSerialversionuid() {
27+
return serialVersionUID;
28+
}
29+
30+
public String getKey() {
31+
return key;
32+
}
33+
34+
public void setKey(String key) {
35+
this.key = key;
36+
}
37+
38+
public String getName() {
39+
return name;
40+
}
41+
42+
public void setName(String name) {
43+
this.name = name;
44+
}
45+
46+
@Override
47+
public String toString() {
48+
return "Application [key=" + key
49+
+ ", name=" + name
50+
+ ", getKey()=" + getKey()
51+
+ ", getName()=" + getName()
52+
+ ", hashCode()=" + hashCode()
53+
+ ", getClass()=" + getClass()
54+
+ ", toString()=" + super.toString()
55+
+ "]";
56+
}
57+
58+
@Override
59+
public boolean equals(Object obj) {
60+
if (this == obj) {
61+
return true;
62+
}
63+
if (obj == null || getClass() != obj.getClass()) {
64+
return false;
65+
}
66+
Application other = (Application) obj;
67+
return Objects.equals(key, other.key)
68+
&& Objects.equals(name, other.name);
69+
}
70+
71+
@Override
72+
public int hashCode() {
73+
final int prime = 31;
74+
int result = 1;
75+
result = prime * result + ((key == null) ? 0 : key.hashCode());
76+
result = prime * result + ((name == null) ? 0 : name.hashCode());
77+
return result;
78+
}
1279
}

duo-universal-sdk/src/main/java/com/duosecurity/model/AuthContext.java

Lines changed: 184 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package com.duosecurity.model;
22

33
import java.io.Serializable;
4-
import lombok.Data;
4+
import java.util.Objects;
55

6-
@Data
76
public class AuthContext implements Serializable {
87
private static final long serialVersionUID = -2431823399834806194L;
98

@@ -16,5 +15,187 @@ public class AuthContext implements Serializable {
1615
private AccessDevice access_device;
1716
private Application application;
1817
private String factor;
19-
private User user;
18+
private User user;
19+
20+
/**
21+
* Constructor with all properties.
22+
*
23+
* @param result result
24+
* @param timestamp timestamp
25+
* @param authDevice auth_device
26+
* @param txid txid
27+
* @param eventType event_type
28+
* @param reason reason
29+
* @param accessDevice access_device
30+
* @param application application
31+
* @param factor factor
32+
* @param user user
33+
*/
34+
public AuthContext(String result, Integer timestamp, AuthDevice authDevice, String txid,
35+
String eventType, String reason, AccessDevice accessDevice, Application application,
36+
String factor, User user) {
37+
this.result = result;
38+
this.timestamp = timestamp;
39+
this.auth_device = authDevice;
40+
this.txid = txid;
41+
this.event_type = eventType;
42+
this.reason = reason;
43+
this.access_device = accessDevice;
44+
this.application = application;
45+
this.factor = factor;
46+
this.user = user;
47+
}
48+
49+
public AuthContext() {
50+
}
51+
52+
public static long getSerialversionuid() {
53+
return serialVersionUID;
54+
}
55+
56+
public String getResult() {
57+
return result;
58+
}
59+
60+
public void setResult(String result) {
61+
this.result = result;
62+
}
63+
64+
public Integer getTimestamp() {
65+
return timestamp;
66+
}
67+
68+
public void setTimestamp(Integer timestamp) {
69+
this.timestamp = timestamp;
70+
}
71+
72+
public AuthDevice getAuth_device() {
73+
return auth_device;
74+
}
75+
76+
public void setAuth_device(AuthDevice authDevice) {
77+
this.auth_device = authDevice;
78+
}
79+
80+
public String getTxid() {
81+
return txid;
82+
}
83+
84+
public void setTxid(String txid) {
85+
this.txid = txid;
86+
}
87+
88+
public String getEvent_type() {
89+
return event_type;
90+
}
91+
92+
public void setEvent_type(String eventType) {
93+
this.event_type = eventType;
94+
}
95+
96+
public String getReason() {
97+
return reason;
98+
}
99+
100+
public void setReason(String reason) {
101+
this.reason = reason;
102+
}
103+
104+
public AccessDevice getAccess_device() {
105+
return access_device;
106+
}
107+
108+
public void setAccess_device(AccessDevice accessDevice) {
109+
this.access_device = accessDevice;
110+
}
111+
112+
public Application getApplication() {
113+
return application;
114+
}
115+
116+
public void setApplication(Application application) {
117+
this.application = application;
118+
}
119+
120+
public String getFactor() {
121+
return factor;
122+
}
123+
124+
public void setFactor(String factor) {
125+
this.factor = factor;
126+
}
127+
128+
public User getUser() {
129+
return user;
130+
}
131+
132+
public void setUser(User user) {
133+
this.user = user;
134+
}
135+
136+
@Override
137+
public String toString() {
138+
return "AuthContext [result=" + result
139+
+ ", timestamp=" + timestamp
140+
+ ", auth_device=" + auth_device
141+
+ ", txid=" + txid
142+
+ ", event_type=" + event_type
143+
+ ", reason=" + reason
144+
+ ", access_device=" + access_device
145+
+ ", application=" + application
146+
+ ", factor=" + factor
147+
+ ", user=" + user
148+
+ ", getAccess_device()=" + getAccess_device()
149+
+ ", getApplication()=" + getApplication()
150+
+ ", getAuth_device()=" + getAuth_device()
151+
+ ", getEvent_type()=" + getEvent_type()
152+
+ ", getFactor()=" + getFactor()
153+
+ ", getReason()=" + getReason()
154+
+ ", getResult()=" + getResult()
155+
+ ", getTimestamp()=" + getTimestamp()
156+
+ ", getTxid()=" + getTxid()
157+
+ ", getUser()=" + getUser()
158+
+ ", hashCode()=" + hashCode()
159+
+ ", getClass()=" + getClass()
160+
+ ", toString()=" + super.toString()
161+
+ "]";
162+
}
163+
164+
@Override
165+
public boolean equals(Object obj) {
166+
if (this == obj) {
167+
return true;
168+
}
169+
if (obj == null || getClass() != obj.getClass()) {
170+
return false;
171+
}
172+
AuthContext other = (AuthContext) obj;
173+
return Objects.equals(result, other.result)
174+
&& Objects.equals(timestamp, other.timestamp)
175+
&& Objects.equals(auth_device, other.auth_device)
176+
&& Objects.equals(txid, other.txid)
177+
&& Objects.equals(event_type, other.event_type)
178+
&& Objects.equals(reason, other.reason)
179+
&& Objects.equals(access_device, other.access_device)
180+
&& Objects.equals(application, other.application)
181+
&& Objects.equals(factor, other.factor)
182+
&& Objects.equals(user, other.user);
183+
}
184+
185+
@Override
186+
public int hashCode() {
187+
final int prime = 31;
188+
int result = 1;
189+
result = prime * result + ((this.result == null) ? 0 : this.result.hashCode());
190+
result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode());
191+
result = prime * result + ((auth_device == null) ? 0 : auth_device.hashCode());
192+
result = prime * result + ((txid == null) ? 0 : txid.hashCode());
193+
result = prime * result + ((event_type == null) ? 0 : event_type.hashCode());
194+
result = prime * result + ((reason == null) ? 0 : reason.hashCode());
195+
result = prime * result + ((access_device == null) ? 0 : access_device.hashCode());
196+
result = prime * result + ((application == null) ? 0 : application.hashCode());
197+
result = prime * result + ((factor == null) ? 0 : factor.hashCode());
198+
result = prime * result + ((user == null) ? 0 : user.hashCode());
199+
return result;
200+
}
20201
}

0 commit comments

Comments
 (0)