Class Message
java.lang.Object
edu.uky.cs.nil.tt.io.Message
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(com.google.gson.GsonBuilder builder) Configures aGsonBuilderto encode and decodeMessageobjects as JSON.getAgent()Returns theAgentwho sent this message, or null if this message was sent by the server.voidSets theAgentwho sent this message.abstract voidverify()Checks that this message is correctly configured and throws an exception if not.
-
Constructor Details
-
Message
public Message()Constructs a message.
-
-
Method Details
-
configure
public static void configure(com.google.gson.GsonBuilder builder) Configures aGsonBuilderto encode and decodeMessageobjects as JSON.- Parameters:
builder- the GSON builder to configure
-
getAgent
-
setAgent
-
verify
public abstract void verify()Checks that this message is correctly configured and throws an exception if not. This method should be called soon after the message has been parsed. It should check that all the necessary fields are set and that their values are legal values.
-