Package com.backblaze.b2.json
Class B2JsonEnumSetHandler
- java.lang.Object
-
- com.backblaze.b2.json.B2JsonInitializedTypeHandler<T>
-
- com.backblaze.b2.json.B2JsonNonUrlTypeHandler<java.util.EnumSet>
-
- com.backblaze.b2.json.B2JsonEnumSetHandler
-
- All Implemented Interfaces:
B2JsonTypeHandler<java.util.EnumSet>
public class B2JsonEnumSetHandler extends B2JsonNonUrlTypeHandler<java.util.EnumSet>
Serialization for enum sets.
-
-
Constructor Summary
Constructors Constructor Description B2JsonEnumSetHandler(B2JsonTypeHandler itemHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.EnumSetdefaultValueForOptional()Returns the default value to use when an optional field is not present.java.util.EnumSetdeserialize(B2JsonReader in, B2JsonOptions options)Deserialize one object from a JSON input stream.java.lang.reflect.TypegetHandledType()What class does this handle?booleanisStringInJson()Does this type look like a string in JSON?voidserialize(java.util.EnumSet obj, B2JsonOptions options, B2JsonWriter out)Serialize one object of the class to a JSON output stream.-
Methods inherited from class com.backblaze.b2.json.B2JsonNonUrlTypeHandler
deserializeUrlParam
-
Methods inherited from class com.backblaze.b2.json.B2JsonInitializedTypeHandler
initializeImplementation, isInitialized
-
-
-
-
Constructor Detail
-
B2JsonEnumSetHandler
public B2JsonEnumSetHandler(B2JsonTypeHandler itemHandler)
-
-
Method Detail
-
getHandledType
public java.lang.reflect.Type getHandledType()
Description copied from interface:B2JsonTypeHandlerWhat class does this handle?- Returns:
-
serialize
public void serialize(java.util.EnumSet obj, B2JsonOptions options, B2JsonWriter out) throws java.io.IOException, B2JsonExceptionDescription copied from interface:B2JsonTypeHandlerSerialize one object of the class to a JSON output stream. The object is guaranteed not to be null.- Throws:
java.io.IOExceptionB2JsonException
-
deserialize
public java.util.EnumSet deserialize(B2JsonReader in, B2JsonOptions options) throws B2JsonException, java.io.IOException
Description copied from interface:B2JsonTypeHandlerDeserialize 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:
B2JsonExceptionjava.io.IOException
-
defaultValueForOptional
public java.util.EnumSet defaultValueForOptional()
Description copied from interface:B2JsonTypeHandlerReturns the default value to use when an optional field is not present.
-
isStringInJson
public boolean isStringInJson()
Description copied from interface:B2JsonTypeHandlerDoes this type look like a string in JSON?
-
-