Class ListConverter


  • public class ListConverter
    extends Object
    The MapConverter is used to convert Lists into JSON objects and vice versa.
    • Constructor Detail

      • ListConverter

        public ListConverter()
    • Method Detail

      • getAsJson

        public JsonValue getAsJson​(Object source,
                                   Maxon maxon)
        Converts the passed Object to a JsonValue, which is then processed further by Maxon.
        Parameters:
        source - the Object that is to be converted
        maxon - the Maxon object used to convert the elements of the map
        Returns:
        the as json
      • getFromJson

        public <T> T getFromJson​(JsonValue source,
                                 Class<T> clazz,
                                 Maxon maxon)
        Extracts information from the passed JsonValue and builds a new Object of the type T out of it.
        Type Parameters:
        T - the type parameter
        Parameters:
        source - the JSON representation of the Object
        clazz - the Class of the Object
        maxon - the Maxon object used to convert the elements of the map
        Returns:
        the extracted Object