Annotation Interface DelegateSerialization
Dual of ConfigurationSerializable
.
While the @ConfigurationSerializable interface is great for generating the serialization code for product types, this annotation is great for sum types. Simply slap this annotation on top of your sealed trait, class or interface and a deserialization method will be generated for it!
Note that you should still annotate the subclasses with ConfigurationSerializable
, or implement
ConfigurationSerializable
manually.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionWith what alias should the top type have?Which deserialization method? Note that usingDeserializationMethod.MAP_CONSTRUCTOR
is disallowed for sum types!At what point should the top type be registered with Bukkit'sConfigurationSerialization
?Class<?>[]
The list of allowed subclasses.
-
Element Details
-
value
Class<?>[] valueThe list of allowed subclasses. You can leave this empty if your type is already sealed at the jvm level and has a permitted-subclasses attribute.- Returns:
- the list of subclasses of the top type.
- Default:
{}
-
as
String asWith what alias should the top type have?- Returns:
- the alias
- Default:
""
-
registerAt
InjectionPoint registerAtAt what point should the top type be registered with Bukkit'sConfigurationSerialization
?- Returns:
- the injection point
- Default:
PLUGIN_ONENABLE
-
constructUsing
DeserializationMethod constructUsingWhich deserialization method? Note that usingDeserializationMethod.MAP_CONSTRUCTOR
is disallowed for sum types!- Returns:
- the deserialization method
- Default:
DESERIALIZE
-