PersistentDataType

Represents a data type that facilitates conversions between a primitive data type and a complex data type.

This interface is designed to provide a flexible mechanism for mapping and transformation between two types, where one is a low-level primitive representation and the other is a higher-level complex type.

The primitive type must adhere to the PrimitiveTypeMarker contract, while the complex type follows the CustomTypeMarker contract. Specific implementations of this interface define the logic for performing the conversions and declaring the associated types.

Author

Fantamomo

Since

1.0-SNAPSHOT

Parameters

P

the primitive data type, which must implement PrimitiveTypeMarker

C

the complex data type, which must implement CustomTypeMarker

Inheritors

Functions

Link copied to clipboard
@JvmName(name = "createList")
inline fun <P : Any, C : Any> PersistentDataType<P, C>.asList(): ListPersistentDataType<P, C>
Link copied to clipboard
@JvmName(name = "createNullable")
inline fun <P : Any, C : Any> PersistentDataType<P, C>.asNullable(): NullablePersistentDataType<P, C>
Link copied to clipboard
@JvmName(name = "createSet")
inline fun <P : Any, C : Any> PersistentDataType<P, C>.asSet(): SetPersistentDataType<P, C>
Link copied to clipboard
abstract fun convertToComplex(primitive: P): C

Converts a primitive data type to a complex data type.

Link copied to clipboard
abstract fun convertToPrimitive(complex: C): P

Converts a complex data type to a primitive data type.

Link copied to clipboard
abstract fun getComplexType(): KClass<C>

Returns the KClass of the complex data type.

Link copied to clipboard
abstract fun getPrimitiveType(): KClass<P>

Returns the KClass of the primitive data type.

Link copied to clipboard
@JvmName(name = "createMap")
infix inline fun <KP : Any, KC : Any, VP : Any, VC : Any> PersistentDataType<KP, KC>.withMap(valueType: PersistentDataType<VP, VC>): MapPersistentDataType<KP, KC, VP, VC>