Class EventCoder

  • All Implemented Interfaces:

    
    public class EventCoder
    
                        

    The helper methods used to encode/decode an Event to/from json String

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static Event decode(String eventString) Decode an event from json string
      static String encode(Event event) Encode an event to a json string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • decode

         static Event decode(String eventString)

        Decode an event from json string

        Parameters:
        eventString - the json string
        Returns:

        the decoded event if the json is valid, otherwise null

      • encode

         static String encode(Event event)

        Encode an event to a json string

        Parameters:
        event - the event to encode
        Returns:

        json string represents all the fields of the event, otherwise returns null if the event is null or there is json error