-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,100 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 87 additions & 2 deletions
89
duo-universal-sdk/src/main/java/com/duosecurity/model/AccessDevice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
71 changes: 69 additions & 2 deletions
71
duo-universal-sdk/src/main/java/com/duosecurity/model/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.