From dbc7264d5fdd8bc406f05dea95b419531eab8952 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 3 Jun 2021 16:31:58 +0200 Subject: [PATCH] fix: added JsonIgnore to EventMessage and RequestMessage variables --- .../gamelibrary/json/login/MessageDeserializer.java | 2 ++ .../marvelous/gamelibrary/messages/EventMessage.java | 7 ++++--- .../marvelous/gamelibrary/messages/RequestMessage.java | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/login/MessageDeserializer.java diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/login/MessageDeserializer.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/login/MessageDeserializer.java new file mode 100644 index 0000000..d33d411 --- /dev/null +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/login/MessageDeserializer.java @@ -0,0 +1,2 @@ +package uulm.teamname.marvelous.gamelibrary.json.login;public class MessageDeserializer { +} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java index a0f703f..d10474b 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/EventMessage.java @@ -1,5 +1,6 @@ package uulm.teamname.marvelous.gamelibrary.messages; +import com.fasterxml.jackson.annotation.JsonIgnore; import uulm.teamname.marvelous.gamelibrary.events.Event; import java.util.Arrays; @@ -21,7 +22,7 @@ public class EventMessage { /** The decoded contents of the custom content sent. */ public HashMap customContent; - @Override + @Override @JsonIgnore public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; @@ -29,14 +30,14 @@ public class EventMessage { return messageType == that.messageType && Arrays.equals(messages, that.messages) && Objects.equals(customContentType, that.customContentType) && Objects.equals(customContent, that.customContent); } - @Override + @Override @JsonIgnore public int hashCode() { int result = Objects.hash(messageType, customContentType, customContent); result = 31 * result + Arrays.hashCode(messages); return result; } - @Override + @Override @JsonIgnore public String toString() { return "MessageStructure{" + "messageType=" + messageType + diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java index 477dcf4..a1c094a 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/RequestMessage.java @@ -1,5 +1,6 @@ package uulm.teamname.marvelous.gamelibrary.messages; +import com.fasterxml.jackson.annotation.JsonIgnore; import uulm.teamname.marvelous.gamelibrary.events.Event; import uulm.teamname.marvelous.gamelibrary.requests.Request; @@ -22,7 +23,7 @@ public class RequestMessage { /** The decoded contents of the custom content sent. */ public HashMap customContent; - @Override + @Override @JsonIgnore public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; @@ -30,14 +31,14 @@ public class RequestMessage { return messageType == that.messageType && Arrays.equals(messages, that.messages) && Objects.equals(customContentType, that.customContentType) && Objects.equals(customContent, that.customContent); } - @Override + @Override @JsonIgnore public int hashCode() { int result = Objects.hash(messageType, customContentType, customContent); result = 31 * result + Arrays.hashCode(messages); return result; } - @Override + @Override @JsonIgnore public String toString() { return "MessageStructure{" + "messageType=" + messageType +