Class DefaultJsonator

    • Constructor Detail

      • DefaultJsonator

        public DefaultJsonator()
    • Method Detail

      • convert

        public com.google.gson.JsonElement convert​(Object object)
        Description copied from interface: Jsonator
        Creates a JsonElement representation of a given object. Enums are converted to their names.
        Specified by:
        convert in interface Jsonator<Object>
        Parameters:
        object - the object to be serialized
        Returns:
        Json JSON representation of the given object
      • convert

        public com.google.common.base.Function<Object,​com.google.gson.JsonElement> convert()
        Specified by:
        convert in interface Jsonator<Object>
        Returns:
        a function to map objects to their JsonElements representation. Enums are converted to their names.
      • convert

        public com.google.gson.JsonElement convert​(Object object,
                                                   Jsonator.EnumConversionMode enumConversionMode)
        Description copied from interface: Jsonator
        Creates a JsonElement representation of a given object
        Specified by:
        convert in interface Jsonator<Object>
        Parameters:
        object - the object to be serialized
        enumConversionMode - defines enum handling
        Returns:
        Json JSON representation of the given object