2 * Sone - Client.java - Copyright © 2010–2019 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.data;
20 import static com.google.common.base.Objects.equal;
22 import com.google.common.base.Objects;
25 * Container for the client information of a {@link Sone}.
29 /** The name of the client. */
30 private final String name;
32 /** The version of the client. */
33 private final String version;
36 * Creates a new client information container.
39 * The name of the client
41 * The version of the client
43 public Client(String name, String version) {
45 this.version = version;
53 * Returns the name of the client.
55 * @return The name of the client
57 public String getName() {
62 * Returns the version of the client.
64 * @return The version of the client
66 public String getVersion() {
71 public boolean equals(Object object) {
72 if (!(object instanceof Client)) {
75 Client client = (Client) object;
76 return equal(getName(), client.getName()) && equal(getVersion(), client.getVersion());
80 public int hashCode() {
81 return Objects.hashCode(name, version);
85 public String toString() {
86 return name + " " + version;