Annotation Interface DelegateSerialization


@Retention(CLASS) @Target(TYPE) public @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:
  • Element Details

    • value

      Class<?>[] value
      The 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 as
      With what alias should the top type have?
      Returns:
      the alias
      Default:
      ""
    • registerAt

      InjectionPoint registerAt
      At what point should the top type be registered with Bukkit's ConfigurationSerialization?
      Returns:
      the injection point
      Default:
      PLUGIN_ONENABLE
    • constructUsing

      DeserializationMethod constructUsing
      Which deserialization method? Note that using DeserializationMethod.MAP_CONSTRUCTOR is disallowed for sum types!
      Returns:
      the deserialization method
      Default:
      DESERIALIZE