Class ValueAdapter<TYPE>
java.lang.Object
cc.carm.lib.configuration.adapter.ValueAdapter<TYPE>
- Type Parameters:
TYPE- The type of the target value
- All Implemented Interfaces:
ValueParser<TYPE>,ValueSerializer<TYPE>
- Direct Known Subclasses:
PrimitiveAdapter
Value adapter, used to convert the value of the configuration file into the objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable ValueParser<TYPE> protected @Nullable ValueSerializer<TYPE> -
Constructor Summary
ConstructorsConstructorDescriptionValueAdapter(@NotNull ValueType<TYPE> type) ValueAdapter(@NotNull ValueType<TYPE> type, @Nullable ValueSerializer<TYPE> serializer, @Nullable ValueParser<TYPE> parser) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()parse(@NotNull ConfigurationHolder<?> holder, @NotNull ValueType<? super TYPE> type, @NotNull Object value) @Nullable ValueParser<TYPE> parser()parser(@Nullable ValueParser<TYPE> deserializer) @Nullable Objectserialize(@NotNull ConfigurationHolder<?> holder, @NotNull ValueType<? super TYPE> type, TYPE value) @Nullable ValueSerializer<TYPE> serializer(@Nullable ValueSerializer<TYPE> serializer) type()
-
Field Details
-
type
-
serializer
-
deserializer
-
-
Constructor Details
-
ValueAdapter
-
ValueAdapter
public ValueAdapter(@NotNull @NotNull ValueType<TYPE> type, @Nullable @Nullable ValueSerializer<TYPE> serializer, @Nullable @Nullable ValueParser<TYPE> parser)
-
-
Method Details
-
type
-
serializer
-
parser
-
serializer
-
parser
-
serialize
@Nullable public @Nullable Object serialize(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull ValueType<? super TYPE> type, @NotNull TYPE value) throws Exception - Specified by:
serializein interfaceValueSerializer<TYPE>- Throws:
Exception
-
parse
@Nullable public TYPE parse(@NotNull @NotNull ConfigurationHolder<?> holder, @NotNull @NotNull ValueType<? super TYPE> type, @NotNull @NotNull Object value) throws Exception - Specified by:
parsein interfaceValueParser<TYPE>- Throws:
Exception
-
equals
-
hashCode
public int hashCode()
-