Skip to content

Commit

Permalink
Remove dependency on Lombok (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysyrota authored Oct 11, 2024
1 parent 2bd472c commit b7e8677
Show file tree
Hide file tree
Showing 12 changed files with 1,100 additions and 29 deletions.
6 changes: 0 additions & 6 deletions duo-universal-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
<artifactId>converter-jackson</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,98 @@
package com.duosecurity.model;

import java.io.Serializable;
import lombok.Data;
import java.util.Objects;

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

private String hostname;
private String ip;
private Location location;


/**
* Constructor with all properties.
*
* @param hostname hostname
* @param ip ip
* @param location location
*/
public AccessDevice(String hostname, String ip, Location location) {
this.hostname = hostname;
this.ip = ip;
this.location = location;
}

public AccessDevice() {
}

public static long getSerialversionuid() {
return serialVersionUID;
}

public String getHostname() {
return hostname;
}

public void setHostname(String hostname) {
this.hostname = hostname;
}

public String getIp() {
return ip;
}

public void setIp(String ip) {
this.ip = ip;
}

public Location getLocation() {
return location;
}

public void setLocation(Location location) {
this.location = location;
}

@Override
public String toString() {
return "AccessDevice [hostname=" + hostname
+ ", ip=" + ip
+ ", location=" + location
+ ", getHostname()=" + getHostname()
+ ", getIp()=" + getIp()
+ ", getLocation()=" + getLocation()
+ ", hashCode()=" + hashCode()
+ ", getClass()=" + getClass()
+ ", toString()=" + super.toString()
+ "]";
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
AccessDevice other = (AccessDevice) obj;
return Objects.equals(hostname, other.hostname)
&& Objects.equals(ip, other.ip)
&& Objects.equals(location, other.location);
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((hostname == null) ? 0 : hostname.hashCode());
result = prime * result + ((ip == null) ? 0 : ip.hashCode());
result = prime * result + ((location == null) ? 0 : location.hashCode());
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,79 @@
package com.duosecurity.model;

import java.io.Serializable;
import lombok.Data;
import java.util.Objects;

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

private String key;
private String name;

/**
* Constructor with all properties.
*
* @param key key
* @param name name
*/
public Application(String key, String name) {
this.key = key;
this.name = name;
}

public Application() {
}

public static long getSerialversionuid() {
return serialVersionUID;
}

public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

@Override
public String toString() {
return "Application [key=" + key
+ ", name=" + name
+ ", getKey()=" + getKey()
+ ", getName()=" + getName()
+ ", hashCode()=" + hashCode()
+ ", getClass()=" + getClass()
+ ", toString()=" + super.toString()
+ "]";
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Application other = (Application) obj;
return Objects.equals(key, other.key)
&& Objects.equals(name, other.name);
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
}
187 changes: 184 additions & 3 deletions duo-universal-sdk/src/main/java/com/duosecurity/model/AuthContext.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.duosecurity.model;

import java.io.Serializable;
import lombok.Data;
import java.util.Objects;

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

Expand All @@ -16,5 +15,187 @@ public class AuthContext implements Serializable {
private AccessDevice access_device;
private Application application;
private String factor;
private User user;
private User user;

/**
* Constructor with all properties.
*
* @param result result
* @param timestamp timestamp
* @param authDevice auth_device
* @param txid txid
* @param eventType event_type
* @param reason reason
* @param accessDevice access_device
* @param application application
* @param factor factor
* @param user user
*/
public AuthContext(String result, Integer timestamp, AuthDevice authDevice, String txid,
String eventType, String reason, AccessDevice accessDevice, Application application,
String factor, User user) {
this.result = result;
this.timestamp = timestamp;
this.auth_device = authDevice;
this.txid = txid;
this.event_type = eventType;
this.reason = reason;
this.access_device = accessDevice;
this.application = application;
this.factor = factor;
this.user = user;
}

public AuthContext() {
}

public static long getSerialversionuid() {
return serialVersionUID;
}

public String getResult() {
return result;
}

public void setResult(String result) {
this.result = result;
}

public Integer getTimestamp() {
return timestamp;
}

public void setTimestamp(Integer timestamp) {
this.timestamp = timestamp;
}

public AuthDevice getAuth_device() {
return auth_device;
}

public void setAuth_device(AuthDevice authDevice) {
this.auth_device = authDevice;
}

public String getTxid() {
return txid;
}

public void setTxid(String txid) {
this.txid = txid;
}

public String getEvent_type() {
return event_type;
}

public void setEvent_type(String eventType) {
this.event_type = eventType;
}

public String getReason() {
return reason;
}

public void setReason(String reason) {
this.reason = reason;
}

public AccessDevice getAccess_device() {
return access_device;
}

public void setAccess_device(AccessDevice accessDevice) {
this.access_device = accessDevice;
}

public Application getApplication() {
return application;
}

public void setApplication(Application application) {
this.application = application;
}

public String getFactor() {
return factor;
}

public void setFactor(String factor) {
this.factor = factor;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

@Override
public String toString() {
return "AuthContext [result=" + result
+ ", timestamp=" + timestamp
+ ", auth_device=" + auth_device
+ ", txid=" + txid
+ ", event_type=" + event_type
+ ", reason=" + reason
+ ", access_device=" + access_device
+ ", application=" + application
+ ", factor=" + factor
+ ", user=" + user
+ ", getAccess_device()=" + getAccess_device()
+ ", getApplication()=" + getApplication()
+ ", getAuth_device()=" + getAuth_device()
+ ", getEvent_type()=" + getEvent_type()
+ ", getFactor()=" + getFactor()
+ ", getReason()=" + getReason()
+ ", getResult()=" + getResult()
+ ", getTimestamp()=" + getTimestamp()
+ ", getTxid()=" + getTxid()
+ ", getUser()=" + getUser()
+ ", hashCode()=" + hashCode()
+ ", getClass()=" + getClass()
+ ", toString()=" + super.toString()
+ "]";
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
AuthContext other = (AuthContext) obj;
return Objects.equals(result, other.result)
&& Objects.equals(timestamp, other.timestamp)
&& Objects.equals(auth_device, other.auth_device)
&& Objects.equals(txid, other.txid)
&& Objects.equals(event_type, other.event_type)
&& Objects.equals(reason, other.reason)
&& Objects.equals(access_device, other.access_device)
&& Objects.equals(application, other.application)
&& Objects.equals(factor, other.factor)
&& Objects.equals(user, other.user);
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.result == null) ? 0 : this.result.hashCode());
result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode());
result = prime * result + ((auth_device == null) ? 0 : auth_device.hashCode());
result = prime * result + ((txid == null) ? 0 : txid.hashCode());
result = prime * result + ((event_type == null) ? 0 : event_type.hashCode());
result = prime * result + ((reason == null) ? 0 : reason.hashCode());
result = prime * result + ((access_device == null) ? 0 : access_device.hashCode());
result = prime * result + ((application == null) ? 0 : application.hashCode());
result = prime * result + ((factor == null) ? 0 : factor.hashCode());
result = prime * result + ((user == null) ? 0 : user.hashCode());
return result;
}
}
Loading

0 comments on commit b7e8677

Please sign in to comment.