Class RecordDeserializer.Builder<R extends Record>
java.lang.Object
dev.siroshun.configapi.core.serialization.record.RecordDeserializer.Builder<R>
- Type Parameters:
R
- the type of theRecord
- Enclosing class:
- RecordDeserializer<R extends Record>
A
RecordDeserializer.Builder
class for RecordDeserializer
.-
Method Summary
Modifier and TypeMethodDescription<T> @NotNull RecordDeserializer.Builder<R>
addDeserializer
(@NotNull Class<T> clazz, @NotNull Deserializer<? super Node<?>, ? extends T> deserializer) Adds aDeserializer
for the specifiesClass
.@NotNull RecordDeserializer.Builder<R>
addDeserializers
(@NotNull DeserializerRegistry<Node<?>> registry) AddsDeserializer
s in theDeserializerRegistry
.@NotNull RecordDeserializer<R>
build()
Creates aRecordDeserializer
from thisRecordDeserializer.Builder
.@NotNull RecordDeserializer.Builder<R>
keyGenerator
(@NotNull KeyGenerator keyGenerator) Sets theKeyGenerator
.
-
Method Details
-
addDeserializer
@Contract("_, _ -> this") @NotNull public <T> @NotNull RecordDeserializer.Builder<R> addDeserializer(@NotNull @NotNull Class<T> clazz, @NotNull @NotNull Deserializer<? super Node<?>, ? extends T> deserializer) Adds aDeserializer
for the specifiesClass
.- Type Parameters:
T
- a type of objects after deserialization- Parameters:
clazz
- a type of objects after deserializationdeserializer
- aDeserializer
- Returns:
- this
RecordDeserializer.Builder
instance
-
addDeserializers
@Contract("_ -> this") @NotNull public @NotNull RecordDeserializer.Builder<R> addDeserializers(@NotNull @NotNull DeserializerRegistry<Node<?>> registry) AddsDeserializer
s in theDeserializerRegistry
.- Parameters:
registry
- aDeserializerRegistry
that containsDeserializer
s to register- Returns:
- this
RecordDeserializer.Builder
instance
-
keyGenerator
@Contract("_ -> this") @NotNull public @NotNull RecordDeserializer.Builder<R> keyGenerator(@NotNull @NotNull KeyGenerator keyGenerator) Sets theKeyGenerator
.- Parameters:
keyGenerator
- theKeyGenerator
to generate keys- Returns:
- this
RecordDeserializer.Builder
instance
-
build
Creates aRecordDeserializer
from thisRecordDeserializer.Builder
.- Returns:
- a
RecordDeserializer
-