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 aDeserializerfor the specifiesClass.@NotNull RecordDeserializer.Builder<R>addDeserializers(@NotNull DeserializerRegistry<Node<?>> registry) AddsDeserializers in theDeserializerRegistry.@NotNull RecordDeserializer<R>build()Creates aRecordDeserializerfrom 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 aDeserializerfor the specifiesClass.- Type Parameters:
T- a type of objects after deserialization- Parameters:
clazz- a type of objects after deserializationdeserializer- aDeserializer- Returns:
- this
RecordDeserializer.Builderinstance
-
addDeserializers
@Contract("_ -> this") @NotNull public @NotNull RecordDeserializer.Builder<R> addDeserializers(@NotNull @NotNull DeserializerRegistry<Node<?>> registry) AddsDeserializers in theDeserializerRegistry.- Parameters:
registry- aDeserializerRegistrythat containsDeserializers to register- Returns:
- this
RecordDeserializer.Builderinstance
-
keyGenerator
@Contract("_ -> this") @NotNull public @NotNull RecordDeserializer.Builder<R> keyGenerator(@NotNull @NotNull KeyGenerator keyGenerator) Sets theKeyGenerator.- Parameters:
keyGenerator- theKeyGeneratorto generate keys- Returns:
- this
RecordDeserializer.Builderinstance
-
build
Creates aRecordDeserializerfrom thisRecordDeserializer.Builder.- Returns:
- a
RecordDeserializer
-