-
- All Implemented Interfaces:
public abstract class ScaleCodecAdapterProviderAdapter provider that provides adapters based on the specified types
-
-
Constructor Summary
Constructors Constructor Description ScaleCodecAdapterProvider()
-
Method Summary
Modifier and Type Method Description final <T extends Any> ScaleCodecAdapter<T>findAdapter(KType type)Provides an adapter for a specified type final <T extends Any> ScaleCodecAdapter<T>findAdapter(KClass<T> type)Provides an adapter for a specified type final <T extends Any> UnitsetAdapter(ScaleCodecAdapter<T> adapter, KType type)Caches an adapter for a specified type final <T extends Any> UnitsetAdapter(ScaleCodecAdapter<T> adapter, KClass<T> type)Caches an adapter for a specified type final <T extends Any> UnitsetAdapter(ScaleCodecAdapterFactory factory, KType type)Caches an adapter using a factory for a specified type final <T extends Any> UnitsetAdapter(ScaleCodecAdapterFactory factory, KClass<T> type)Caches an adapter using a factory for a specified type final UnitsetNullableAdapter(ScaleCodecAdapterFactory factory)Sets a nullable adapter using a factory final <T extends Any> UnitsetNullableAdapter(ScaleCodecAdapter<T> adapter, KType type)Sets a nullable adapter for a generic type T final <T extends Any> UnitaddConditionalAdapter(ScaleCodecAdapter<T> adapter, Function1<KType, Boolean> condition)Adds a conditional adapter for a generic type T and for a specific condition final UnitaddConditionalAdapter(ScaleCodecAdapterFactory factory, Function1<KType, Boolean> condition)Adds a conditional adapter using a factory and for a specific condition final UnitaddGenericAdapter(ScaleCodecAdapterFactory factory)Adds a generic adapter using a factory -
-
Method Detail
-
findAdapter
final <T extends Any> ScaleCodecAdapter<T> findAdapter(KType type)
Provides an adapter for a specified type
- Parameters:
type- a type to find an adapter for
-
findAdapter
final <T extends Any> ScaleCodecAdapter<T> findAdapter(KClass<T> type)
Provides an adapter for a specified type
- Parameters:
type- a type to find an adapter for
-
setAdapter
final <T extends Any> Unit setAdapter(ScaleCodecAdapter<T> adapter, KType type)
Caches an adapter for a specified type
- Parameters:
adapter- an adapter to cachetype- A type for which it needs to be cached
-
setAdapter
final <T extends Any> Unit setAdapter(ScaleCodecAdapter<T> adapter, KClass<T> type)
Caches an adapter for a specified type
- Parameters:
adapter- an adapter to cachetype- A type for which it needs to be cached
-
setAdapter
final <T extends Any> Unit setAdapter(ScaleCodecAdapterFactory factory, KType type)
Caches an adapter using a factory for a specified type
- Parameters:
factory- a factory from which an adapter is created latertype- a type for which it needs to be cached
-
setAdapter
final <T extends Any> Unit setAdapter(ScaleCodecAdapterFactory factory, KClass<T> type)
Caches an adapter using a factory for a specified type
- Parameters:
factory- a factory from which an adapter is created latertype- a type for which it needs to be cached
-
setNullableAdapter
final Unit setNullableAdapter(ScaleCodecAdapterFactory factory)
Sets a nullable adapter using a factory
- Parameters:
factory- a factory used to create an adapter
-
setNullableAdapter
final <T extends Any> Unit setNullableAdapter(ScaleCodecAdapter<T> adapter, KType type)
Sets a nullable adapter for a generic type T
- Parameters:
adapter- adapter to set
-
addConditionalAdapter
final <T extends Any> Unit addConditionalAdapter(ScaleCodecAdapter<T> adapter, Function1<KType, Boolean> condition)
Adds a conditional adapter for a generic type T and for a specific condition
- Parameters:
adapter- an adapter to be addedcondition- a condition based on which the adapter should be added
-
addConditionalAdapter
final Unit addConditionalAdapter(ScaleCodecAdapterFactory factory, Function1<KType, Boolean> condition)
Adds a conditional adapter using a factory and for a specific condition
- Parameters:
factory- a factory to create an adapter to addcondition- a condition based on which the adapter will be added
-
addGenericAdapter
final Unit addGenericAdapter(ScaleCodecAdapterFactory factory)
Adds a generic adapter using a factory
- Parameters:
factory- a factory used to create a generic adapter
-
-
-
-