Class JsonHandler


  • public abstract class JsonHandler
    extends Object
    • Field Detail

      • jsonParser

        protected final com.google.gson.JsonParser jsonParser
    • Constructor Detail

      • JsonHandler

        public JsonHandler​(ADPPlugin plugin)
    • Method Detail

      • sendMessage

        public abstract boolean sendMessage​(Object user,
                                            String jsonMessage)
        Send a json message to the user
        Parameters:
        user - user that receive the message
        jsonMessage - message formatted as json
        Returns:
        true if the message has been sent
      • isJson

        public boolean isJson​(String jsonMessage)
        Is the message json formatted?
        Parameters:
        jsonMessage - message formatted as json
        Returns:
        true if the message is correctly formatted as json
      • removeJson

        public String removeJson​(String jsonMessage)
        Convert a JSON message into a plain message
        Parameters:
        jsonMessage - message formatted as json
        Returns:
        the plain message