Package com.backblaze.b2.json
Interface B2JsonTypeHandler<T>
-
- All Known Implementing Classes:
B2JsonAtomicLongArrayHandler
,B2JsonBigDecimalHandler
,B2JsonBigIntegerHandler
,B2JsonBooleanArrayHandler
,B2JsonBooleanHandler
,B2JsonByteArrayHandler
,B2JsonByteHandler
,B2JsonCharacterHandler
,B2JsonCharArrayHandler
,B2JsonCharSquenceHandler
,B2JsonConcurrentMapHandler
,B2JsonDoubleArrayHandler
,B2JsonDoubleHandler
,B2JsonEnumHandler
,B2JsonEnumSetHandler
,B2JsonFloatArrayHandler
,B2JsonFloatHandler
,B2JsonInitializedTypeHandler
,B2JsonIntArrayHandler
,B2JsonIntegerHandler
,B2JsonLinkedHashSetHandler
,B2JsonListHandler
,B2JsonLocalDateHandler
,B2JsonLocalDateTimeHandler
,B2JsonLongArrayHandler
,B2JsonLongHandler
,B2JsonMapHandler
,B2JsonNonUrlTypeHandler
,B2JsonObjectArrayHandler
,B2JsonObjectHandler
,B2JsonSetHandler
,B2JsonStringHandler
,B2JsonTreeSetHandler
,B2JsonTypeHandlerWithDefaults
,B2JsonUnionBaseHandler
public interface B2JsonTypeHandler<T>
Interface for (de)serializing one class of object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
defaultValueForOptional()
Returns the default value to use when an optional field is not present.T
deserialize(B2JsonReader in, B2JsonOptions options)
Deserialize one object from a JSON input stream.T
deserializeUrlParam(java.lang.String urlValue)
When an API is called with GET, this is used to deserialize one of the values.java.lang.reflect.Type
getHandledType()
What class does this handle?boolean
isStringInJson()
Does this type look like a string in JSON?void
serialize(T obj, B2JsonOptions options, B2JsonWriter out)
Serialize one object of the class to a JSON output stream.
-
-
-
Method Detail
-
getHandledType
java.lang.reflect.Type getHandledType()
What class does this handle?- Returns:
-
serialize
void serialize(T obj, B2JsonOptions options, B2JsonWriter out) throws java.io.IOException, B2JsonException
Serialize one object of the class to a JSON output stream. The object is guaranteed not to be null.- Throws:
java.io.IOException
B2JsonException
-
deserialize
T deserialize(B2JsonReader in, B2JsonOptions options) throws B2JsonException, java.io.IOException
Deserialize one object from a JSON input stream. Will never be called when there is "null" in the input stream, and will never return null.- Throws:
B2JsonException
java.io.IOException
-
deserializeUrlParam
T deserializeUrlParam(java.lang.String urlValue) throws B2JsonException
When an API is called with GET, this is used to deserialize one of the values.- Throws:
B2JsonException
-
defaultValueForOptional
T defaultValueForOptional()
Returns the default value to use when an optional field is not present.
-
isStringInJson
boolean isStringInJson()
Does this type look like a string in JSON?
-
-