Package com.atlassian.bamboo.jsonator
Interface Jsonator<T>
- All Known Implementing Classes:
DefaultJsonator
public interface Jsonator<T>
Interface to implement if you want to provide a method to create
a JSON representation of an object
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Defines handling of Java enums during Object to JSON conversion. -
Method Summary
Modifier and TypeMethodDescriptionconvert()
com.google.gson.JsonElement
Creates aJsonElement
representation of a given object.com.google.gson.JsonElement
convert
(T object, Jsonator.EnumConversionMode enumConversionMode) Creates aJsonElement
representation of a given object
-
Method Details
-
convert
Creates aJsonElement
representation of a given object. Enums are converted to their names.- Parameters:
object
- the object to be serialized- Returns:
- Json JSON representation of the given object
-
convert
- Returns:
- a function to map objects to their
JsonElement
s representation. Enums are converted to their names.
-
convert
Creates aJsonElement
representation of a given object- Parameters:
object
- the object to be serializedenumConversionMode
- defines enum handling- Returns:
- Json JSON representation of the given object
-