Package space.arim.dazzleconf.serialiser
Class URLValueSerialiser
java.lang.Object
space.arim.dazzleconf.serialiser.URLValueSerialiser
- All Implemented Interfaces:
ValueSerialiser<URL>
Value serialiser for
URL- Author:
- A248
-
Method Summary
Modifier and TypeMethodDescriptiondeserialise(FlexibleType flexibleType) Deserializes a value from a flexible type representing a raw config value.static URLValueSerialiserGets the target type of deserializationserialise(URL value, Decomposer decomposer) Serializes a value to a raw config value.
-
Method Details
-
getInstance
-
getTargetClass
Description copied from interface:ValueSerialiserGets the target type of deserialization- Specified by:
getTargetClassin interfaceValueSerialiser<URL>- Returns:
- the target class type
-
deserialise
Description copied from interface:ValueSerialiserDeserializes a value from a flexible type representing a raw config value.
The key (FlexibleType.getAssociatedKey()) is informative. It should not affect the deserialization, but should be included in thrownBadValueExceptions to inform the user which key is in question. To easily include the key in aBadValueException, useFlexibleType.badValueExceptionBuilder()- Specified by:
deserialisein interfaceValueSerialiser<URL>- Parameters:
flexibleType- the flexible type- Returns:
- the deserialized value, never null
- Throws:
BadValueException- if the value could not be deserialized
-
serialise
Description copied from interface:ValueSerialiserSerializes a value to a raw config value. Should be the inverse operation ofValueSerialiser.deserialise(FlexibleType)in that if the result of this method were wrapped in aFlexibleType, it could be deserialized.
If this serializer serializes values by converting from another custom type, then the provideddecomposershould be used to reserialize such custom types.- Specified by:
serialisein interfaceValueSerialiser<URL>- Parameters:
value- the valuedecomposer- the decomposer used to help breakdown the value- Returns:
- the serialized value
-