diff options
author | Cow <cow@volloeko.de> | 2020-07-05 05:42:45 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2020-07-05 05:42:45 +0200 |
commit | 1b446698398c648b38311975a6cfd54859ea5cfe (patch) | |
tree | 521ecc4ce9ad968281094eb8c5453dca606931e3 /src/main/java/eu/olli/cowlection/data/Friend.java | |
parent | edaca1fd41a612c71c526ceb20b89c5dec2d81b3 (diff) | |
download | Cowlection-1b446698398c648b38311975a6cfd54859ea5cfe.tar.gz Cowlection-1b446698398c648b38311975a6cfd54859ea5cfe.tar.bz2 Cowlection-1b446698398c648b38311975a6cfd54859ea5cfe.zip |
Renamed mod to Cowlection
Bumped version to 1.8.9-0.7.0
Diffstat (limited to 'src/main/java/eu/olli/cowlection/data/Friend.java')
-rw-r--r-- | src/main/java/eu/olli/cowlection/data/Friend.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/main/java/eu/olli/cowlection/data/Friend.java b/src/main/java/eu/olli/cowlection/data/Friend.java new file mode 100644 index 0000000..42c45e8 --- /dev/null +++ b/src/main/java/eu/olli/cowlection/data/Friend.java @@ -0,0 +1,65 @@ +package eu.olli.cowlection.data; + +import java.util.Objects; +import java.util.UUID; + +public class Friend { + public static final Friend FRIEND_NOT_FOUND = new Friend(); + private UUID id; + private String name; + private long lastChecked; + + static { + // uuid & name are null + FRIEND_NOT_FOUND.setLastChecked(0); + } + + /** + * No-args constructor for GSON + */ + private Friend() { + this.lastChecked = System.currentTimeMillis(); + } + + public UUID getUuid() { + return id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public long getLastChecked() { + return lastChecked; + } + + public void setLastChecked(long lastChecked) { + this.lastChecked = lastChecked; + } + + @Override + public String toString() { + return "Friend{" + + "uuid=" + id + + ", name='" + name + '\'' + + ", lastChecked=" + lastChecked + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Friend friend = (Friend) o; + return Objects.equals(id, friend.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } +} |