Module io.github.bucket4j.core
Interface SerializationHandle<T>
-
public interface SerializationHandle<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <I> Tdeserialize(DeserializationAdapter<I> adapter, I input)TfromJsonCompatibleSnapshot(Map<String,Object> snapshot)Class<T>getSerializedType()intgetTypeId()StringgetTypeName()default double[]readDoubleArray(Map<String,Object> snapshot, String fieldName)default intreadIntValue(Map<String,Object> snapshot, String fieldName)default long[]readLongArray(Map<String,Object> snapshot, String fieldName)default LongreadLongValue(Map<String,Object> snapshot, String fieldName)default IntegerreadOptionalIntValue(Map<String,Object> snapshot, String fieldName)default LongreadOptionalLongValue(Map<String,Object> snapshot, String fieldName)<O> voidserialize(SerializationAdapter<O> adapter, O output, T serializableObject, Version backwardCompatibilityVersion, Scope scope)Map<String,Object>toJsonCompatibleSnapshot(T serializableObject, Version backwardCompatibilityVersion, Scope scope)
-
-
-
Method Detail
-
deserialize
<I> T deserialize(DeserializationAdapter<I> adapter, I input) throws IOException
- Throws:
IOException
-
serialize
<O> void serialize(SerializationAdapter<O> adapter, O output, T serializableObject, Version backwardCompatibilityVersion, Scope scope) throws IOException
- Throws:
IOException
-
getTypeId
int getTypeId()
- Returns:
- the type identifier that is unique across all Bucket4j classes
-
fromJsonCompatibleSnapshot
T fromJsonCompatibleSnapshot(Map<String,Object> snapshot) throws IOException
- Throws:
IOException
-
toJsonCompatibleSnapshot
Map<String,Object> toJsonCompatibleSnapshot(T serializableObject, Version backwardCompatibilityVersion, Scope scope) throws IOException
- Throws:
IOException
-
getTypeName
String getTypeName()
- Returns:
- the type identifier that is unique across all Bucket4j classes
-
readOptionalLongValue
default Long readOptionalLongValue(Map<String,Object> snapshot, String fieldName)
-
readOptionalIntValue
default Integer readOptionalIntValue(Map<String,Object> snapshot, String fieldName)
-
-