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 aSerializer
for the specifiesClass
.@NotNull RecordSerializer.Builder<R>
addSerializers
(@NotNull SerializerRegistry<Node<?>> registry) AddsSerializer
s in theSerializerRegistry
.@NotNull RecordSerializer<R>
build()
Creates aRecordSerializer
from 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 aSerializer
for the specifiesClass
.- Type Parameters:
T
- a type of objects to serialize- Parameters:
clazz
- a type of objects to serializeserializer
- aSerializer
- Returns:
- this
RecordSerializer.Builder
instance
-
addSerializers
@Contract("_ -> this") @NotNull public @NotNull RecordSerializer.Builder<R> addSerializers(@NotNull @NotNull SerializerRegistry<Node<?>> registry) AddsSerializer
s in theSerializerRegistry
.- Parameters:
registry
- aSerializerRegistry
that containsSerializer
s to register- Returns:
- this
RecordSerializer.Builder
instance
-
keyGenerator
@Contract("_ -> this") @NotNull public @NotNull RecordSerializer.Builder<R> keyGenerator(@NotNull @NotNull KeyGenerator keyGenerator) Sets theKeyGenerator
.- Parameters:
keyGenerator
- theKeyGenerator
to generate keys- Returns:
- this
RecordSerializer.Builder
instance
-
build
Creates aRecordSerializer
from thisRecordSerializer.Builder
.- Returns:
- a
RecordSerializer
- See Also:
-