-
- All Implemented Interfaces:
public final class ScaleCodec<Data extends Object>Scale coded that handles converting objects to ByteArray and back
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classScaleCodec.Companion
-
Field Summary
Fields Modifier and Type Field Description private ScaleCodecSettings<Data>settings
-
Constructor Summary
Constructors Constructor Description ScaleCodec(ScaleCodecSettings<Data> settings)
-
Method Summary
Modifier and Type Method Description final ScaleCodecSettings<Data>getSettings()settings for a scale codec final UnitsetSettings(ScaleCodecSettings<Data> settings)settings for a scale codec final <T extends Any> TfromScale(Data data, KType type)This method deserializes object of given Kotlin type final <T extends Any> TfromScale(Data data, KClass<T> type)This method deserializes object of given Kotlin class final <T extends Any> DatatoScale(T obj, KType type)This method serializes object of given nonnull Kotlin type final <T extends Any> DatatoScale(T obj, KClass<T> type)This method serializes object of given nonnull Kotlin class final ScaleCodecTransaction<Data>transaction()Grouped scale encoding -
-
Constructor Detail
-
ScaleCodec
ScaleCodec(ScaleCodecSettings<Data> settings)
-
-
Method Detail
-
getSettings
final ScaleCodecSettings<Data> getSettings()
settings for a scale codec
-
setSettings
final Unit setSettings(ScaleCodecSettings<Data> settings)
settings for a scale codec
-
fromScale
final <T extends Any> T fromScale(Data data, KType type)
This method deserializes object of given Kotlin type
- Parameters:
data- data to be deserializedtype- a type to deserialize to
-
fromScale
final <T extends Any> T fromScale(Data data, KClass<T> type)
This method deserializes object of given Kotlin class
- Parameters:
data- data to be deserializedtype- a type to deserialize to
-
toScale
final <T extends Any> Data toScale(T obj, KType type)
This method serializes object of given nonnull Kotlin type
- Parameters:
obj- a generic object to be deserializedtype- a type to deserialize to
-
toScale
final <T extends Any> Data toScale(T obj, KClass<T> type)
This method serializes object of given nonnull Kotlin class
- Parameters:
obj- a generic object to be serialized
-
transaction
final ScaleCodecTransaction<Data> transaction()
Grouped scale encoding
-
-
-
-