Class RecordDeserializer<R extends Record>
java.lang.Object
dev.siroshun.configapi.serialization.record.RecordDeserializer<R>
- Type Parameters:
R
- the type of theRecord
- All Implemented Interfaces:
dev.siroshun.serialization.core.Deserializer<MapNode,
,R> Function<MapNode,
R>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
RecordDeserializer.Builder<R extends Record>
ARecordDeserializer.Builder
class forRecordDeserializer
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends Record>
@NotNull RecordDeserializer.Builder<R> Creates a newRecordDeserializer.Builder
of the specifiedRecord
class.static <R extends Record>
@NotNull RecordDeserializer.Builder<R> builder
(R defaultRecord) Creates a newRecordDeserializer.Builder
with the default record.static <R extends Record>
@NotNull RecordDeserializer<R> CreatesRecordDeserializer
of the specifiedRecord
class.static <R extends Record>
@NotNull RecordDeserializer<R> create
(@NotNull Class<? extends R> recordClass, @NotNull dev.siroshun.serialization.core.key.KeyGenerator keyGenerator) CreatesRecordDeserializer
of the specifiedRecord
class.static <R extends Record>
@NotNull RecordDeserializer<R> create
(R defaultRecord) CreatesRecordDeserializer
with the default record.static <R extends Record>
@NotNull RecordDeserializer<R> create
(R defaultRecord, @NotNull dev.siroshun.serialization.core.key.KeyGenerator keyGenerator) CreatesRecordDeserializer
with the default record.deserialize
(@NotNull MapNode input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.siroshun.serialization.core.Deserializer
andThen, apply, compose
-
Method Details
-
create
@Contract("_ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer<R> create(@NotNull @NotNull Class<? extends R> recordClass) CreatesRecordDeserializer
of the specifiedRecord
class.- Type Parameters:
R
- the type of theRecord
- Parameters:
recordClass
- the class of theRecord
- Returns:
RecordDeserializer
of the specifiedRecord
class
-
create
@Contract("_, _ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer<R> create(@NotNull @NotNull Class<? extends R> recordClass, @NotNull @NotNull dev.siroshun.serialization.core.key.KeyGenerator keyGenerator) CreatesRecordDeserializer
of the specifiedRecord
class.- Type Parameters:
R
- the type of theRecord
- Parameters:
recordClass
- the class of theRecord
keyGenerator
- theKeyGenerator
to generate keys from field names- Returns:
RecordDeserializer
of the specifiedRecord
class
-
create
@Contract("_ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer<R> create(@NotNull R defaultRecord) CreatesRecordDeserializer
with the default record.- Type Parameters:
R
- the type of theRecord
- Parameters:
defaultRecord
- the defaultRecord
to get the default value if the value is not found in theMapNode
- Returns:
RecordDeserializer
of the specifiedRecord
class
-
create
@Contract("_, _ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer<R> create(@NotNull R defaultRecord, @NotNull @NotNull dev.siroshun.serialization.core.key.KeyGenerator keyGenerator) CreatesRecordDeserializer
with the default record.- Type Parameters:
R
- the type of theRecord
- Parameters:
defaultRecord
- the defaultRecord
to get the default value if the value is not found in theMapNode
keyGenerator
- theKeyGenerator
to generate keys from field names- Returns:
RecordDeserializer
of the specifiedRecord
class
-
builder
@Contract("_ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer.Builder<R> builder(@NotNull @NotNull Class<? extends R> recordClass) Creates a newRecordDeserializer.Builder
of the specifiedRecord
class.- Type Parameters:
R
- the type of theRecord
- Parameters:
recordClass
- the class of theRecord
- Returns:
RecordDeserializer.Builder
of the specifiedRecord
class
-
builder
@Contract("_ -> new") @NotNull public static <R extends Record> @NotNull RecordDeserializer.Builder<R> builder(@NotNull R defaultRecord) Creates a newRecordDeserializer.Builder
with the default record.- Type Parameters:
R
- the type of theRecord
- Parameters:
defaultRecord
- the defaultRecord
to get the default value if the value is not found in theMapNode
- Returns:
RecordDeserializer.Builder
of the specifiedRecord
class
-
deserialize
-