fix: added JsonIgnore to EventMessage and RequestMessage variables

This commit is contained in:
Yannik Bretschneider 2021-06-03 16:31:58 +02:00
parent 00fd033b61
commit dbc7264d5f
3 changed files with 10 additions and 6 deletions

View File

@ -0,0 +1,2 @@
package uulm.teamname.marvelous.gamelibrary.json.login;public class MessageDeserializer {
}

View File

@ -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<String, Object> 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 +

View File

@ -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<String, Object> 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 +