From c7055129b6e2bd51dafa7441a91e1317084d821b Mon Sep 17 00:00:00 2001 From: sanik2021 Date: Thu, 10 Jan 2019 02:40:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= =?UTF-8?q?=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/profiles/ClientProfile.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java index 44a6248d..6f6c1945 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -16,6 +16,7 @@ public ClientProfile(String version, String assetIndex, int sortIndex, String ti this.assetIndex = assetIndex; this.sortIndex = sortIndex; this.title = title; + this.info = info; this.serverAddress = serverAddress; this.serverPort = serverPort; this.updateFastCheck = updateFastCheck; @@ -89,6 +90,8 @@ public String toString() { @LauncherAPI private String title; @LauncherAPI + private String info; + @LauncherAPI private String serverAddress; @LauncherAPI private int serverPort; @@ -375,6 +378,11 @@ public String getTitle() { return title; } + @LauncherAPI + public String getInfo() { + return info; + } + @LauncherAPI public Version getVersion() { return Version.byName(version); @@ -396,6 +404,11 @@ public void setTitle(String title) { this.title = title; } + @LauncherAPI + public void setInfo(String info) { + this.info = info; + } + @LauncherAPI public void setVersion(Version version) { this.version = version.name; @@ -414,6 +427,7 @@ public void verify() { // Client VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Profile title can't be empty"); + VerifyHelper.verify(getInfo(), VerifyHelper.NOT_EMPTY, "Profile info can't be empty"); VerifyHelper.verify(getServerAddress(), VerifyHelper.NOT_EMPTY, "Server address can't be empty"); VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort()); @@ -435,7 +449,8 @@ public int hashCode() { result = prime * result + ((serverAddress == null) ? 0 : serverAddress.hashCode()); result = prime * result + serverPort; result = prime * result + sortIndex; - result = prime * result + ((title == null) ? 0 : title.hashCode()); + result = prime * result + ((title == null) ? 0 : title.hashCode()); + result = prime * result + ((info == null) ? 0 : info.hashCode()); result = prime * result + ((update == null) ? 0 : update.hashCode()); result = prime * result + ((updateExclusions == null) ? 0 : updateExclusions.hashCode()); result = prime * result + (updateFastCheck ? 1231 : 1237); @@ -502,10 +517,15 @@ public boolean equals(Object obj) { if (sortIndex != other.sortIndex) return false; if (title == null) { - if (other.title != null) - return false; - } else if (!title.equals(other.title)) - return false; + if (other.title != null) + return false; + } else if (!title.equals(other.title)) + return false; + if (info == null) { + if (other.info != null) + return false; + } else if (!info.equals(other.info)) + return false; if (update == null) { if (other.update != null) return false;