Class RecordSerializer.Builder<R extends Record>
java.lang.Object
dev.siroshun.configapi.core.serialization.record.RecordSerializer.Builder<R>
- Type Parameters:
R- the type of theRecord
- Enclosing class:
- RecordSerializer<R extends Record>
A
RecordSerializer.Builder class for RecordSerializer.-
Method Summary
Modifier and TypeMethodDescription<T> @NotNull RecordSerializer.Builder<R>addSerializer(@NotNull Class<T> clazz, @NotNull Serializer<? super T, ? extends Node<?>> serializer) Adds aSerializerfor the specifiesClass.@NotNull RecordSerializer.Builder<R>addSerializers(@NotNull SerializerRegistry<Node<?>> registry) AddsSerializers in theSerializerRegistry.@NotNull RecordSerializer<R>build()Creates aRecordSerializerfrom thisRecordSerializer.Builder.@NotNull RecordSerializer.Builder<R>keyGenerator(@NotNull KeyGenerator keyGenerator) Sets theKeyGenerator.
-
Method Details
-
addSerializer
@Contract("_, _ -> this") @NotNull public <T> @NotNull RecordSerializer.Builder<R> addSerializer(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull Serializer<? super T, ? extends Node<?>> serializer) Adds aSerializerfor the specifiesClass.- Type Parameters:
T- a type of objects to serialize- Parameters:
clazz- a type of objects to serializeserializer- aSerializer- Returns:
- this
RecordSerializer.Builderinstance
-
addSerializers
@Contract("_ -> this") @NotNull public @NotNull RecordSerializer.Builder<R> addSerializers(@NotNull @NotNull SerializerRegistry<Node<?>> registry) AddsSerializers in theSerializerRegistry.- Parameters:
registry- aSerializerRegistrythat containsSerializers to register- Returns:
- this
RecordSerializer.Builderinstance
-
keyGenerator
@Contract("_ -> this") @NotNull public @NotNull RecordSerializer.Builder<R> keyGenerator(@NotNull @NotNull KeyGenerator keyGenerator) Sets theKeyGenerator.- Parameters:
keyGenerator- theKeyGeneratorto generate keys- Returns:
- this
RecordSerializer.Builderinstance
-
build
Creates aRecordSerializerfrom thisRecordSerializer.Builder.- Returns:
- a
RecordSerializer - See Also:
-