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)
Deserialises a value from a flexible type representing a raw config value.static URLValueSerialiser
Gets the target type of deserialisationserialise(URL value, Decomposer decomposer)
Serialises a value to a raw config value.
-
Method Details
-
getInstance
-
getTargetClass
Description copied from interface:ValueSerialiser
Gets the target type of deserialisation- Specified by:
getTargetClass
in interfaceValueSerialiser<URL>
- Returns:
- the target class type
-
deserialise
Description copied from interface:ValueSerialiser
Deserialises a value from a flexible type representing a raw config value.
The key (FlexibleType.getAssociatedKey()
) is informative. It should not affect the deserialisation, but should be included in thrownBadValueException
s to inform the user which key is in question.- Specified by:
deserialise
in interfaceValueSerialiser<URL>
- Parameters:
flexibleType
- the flexible type- Returns:
- the deserialised value, never
null
- Throws:
BadValueException
- if the value could not be deserialised
-
serialise
Description copied from interface:ValueSerialiser
Serialises 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 deserialised.
If this serialiser serialises values by converting from another custom type, then the provideddecomposer
should be used to reserialise such custom types.- Specified by:
serialise
in interfaceValueSerialiser<URL>
- Parameters:
value
- the valuedecomposer
- the decomposer used to help breakdown the value- Returns:
- the serialised value
-