X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FClient.java;h=650ef167c9efe032336e019f9deffa462321976f;hp=b77b9f20c968d905b10a03124896e86b05d5be4d;hb=6f1f26e3998cfef155b0cf59152827accea70d30;hpb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792 diff --git a/src/main/java/net/pterodactylus/sone/data/Client.java b/src/main/java/net/pterodactylus/sone/data/Client.java index b77b9f2..650ef16 100644 --- a/src/main/java/net/pterodactylus/sone/data/Client.java +++ b/src/main/java/net/pterodactylus/sone/data/Client.java @@ -1,5 +1,5 @@ /* - * Sone - Client.java - Copyright © 2010–2013 David Roden + * Sone - Client.java - Copyright © 2010–2016 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ package net.pterodactylus.sone.data; +import static com.google.common.base.Objects.equal; + +import com.google.common.base.Objects; + /** * Container for the client information of a {@link Sone}. * @@ -65,4 +69,18 @@ public class Client { return version; } + @Override + public boolean equals(Object object) { + if (!(object instanceof Client)) { + return false; + } + Client client = (Client) object; + return equal(getName(), client.getName()) && equal(getVersion(), client.getVersion()); + } + + @Override + public int hashCode() { + return Objects.hashCode(name, version); + } + }