Annotation Interface Serializable


@Retention(RUNTIME) @Target(FIELD) public @interface Serializable
Annotation indicating that a field should be deserialized or serialized from the config. By default, this annotation is not assumed.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends TypeAdapter>
    Adapter override class.
    The comment to apply before the element when serializing.
    boolean
    Indicates whether this field is required to be present in the config.
    boolean
    Whether to serialize the value to the config.
    When not empty, this value overrides the auto generated serialized key in the config.
  • Element Details

    • required

      boolean required
      Indicates whether this field is required to be present in the config. If the field is not present, and required = true, then an exception will be thrown during deserialization. If required = false and the field is not present, then the field value will remain unmodified.
      Default:
      false
    • comment

      String comment
      The comment to apply before the element when serializing.
      Default:
      ""
    • adapter

      Class<? extends TypeAdapter> adapter
      Adapter override class. The class must have a public no-args constructor.
      Default:
      ca.spottedleaf.yamlconfig.adapter.TypeAdapter.class
    • serialize

      boolean serialize
      Whether to serialize the value to the config.
      Default:
      true
    • serializedKey

      String serializedKey
      When not empty, this value overrides the auto generated serialized key in the config.
      Default:
      ""