diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/BasicMessage.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/BasicMessage.java index 779b4cb..d514c0c 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/BasicMessage.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/BasicMessage.java @@ -7,6 +7,10 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import uulm.teamname.marvelous.gamelibrary.messages.client.*; import uulm.teamname.marvelous.gamelibrary.messages.server.*; +import com.fasterxml.jackson.annotation.JsonTypeInfo.As; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + import java.util.Objects; /** @@ -14,7 +18,7 @@ import java.util.Objects; * messageType, as fields that aren't sent are null. Note that most messages are not deserialized into the {@link * BasicMessage}, but instead into messages such as the {@link EventMessage} or {@link GameAssignmentMessage}. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "messageType") +@JsonTypeInfo(use = Id.NAME, include = As.EXISTING_PROPERTY, property = "messageType") @JsonSubTypes({ @Type(value = HelloClientMessage.class, name = "HELLO_CLIENT"), @Type(value = HelloServerMessage.class, name = "HELLO_SERVER"), @@ -30,7 +34,7 @@ import java.util.Objects; @Type(value = RequestMessage.class, name = "REQUESTS"), @Type(value = GoodbyeClientMessage.class, name = "GOODBYE_CLIENT") }) -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(Include.NON_NULL) public class BasicMessage { /* The messageType describes the type of message that might be sent. Override this with the local MessageType. */