withKeySpec

fun <T, PK : KeyType> ItemConverter<T>.withKeySpec(partitionKey: KeySpec<PK>, attributes: Attributes = emptyAttributes()): ItemSchema.PartitionKey<T, PK>

Associate this ItemConverter with a KeySpec for a partition key to form a complete ItemSchema

Parameters

partitionKey

The KeySpec that describes the partition key

attributes

An optional Attributes instance which may include additional metadata about the schema. If not provided, defaults to emptyAttributes.

Type Parameters

T

The type of objects described by this schema

PK

The type of the partition key property, either KeyType or one of its specific derivations


fun <T, PK : KeyType, SK : KeyType> ItemConverter<T>.withKeySpec(partitionKey: KeySpec<PK>, sortKey: KeySpec<SK>, attributes: Attributes = emptyAttributes()): ItemSchema.CompositeKey<T, PK, SK>

Associate this ItemConverter with KeySpec instances for a composite key to form a complete ItemSchema

Parameters

partitionKey

The KeySpec that describes the partition key

sortKey

The KeySpec that describes the sort key

attributes

An optional Attributes instance which may include additional metadata about the schema. If not provided, defaults to emptyAttributes.

Type Parameters

T

The type of objects described by this schema

PK

The type of the partition key property, either KeyType or one of its specific derivations

SK

The type of the sort key property, either KeyType or one of its specific derivations