Enum UpdateReason

java.lang.Object
java.lang.Enum<UpdateReason>
space.arim.dazzleconf.engine.UpdateReason
All Implemented Interfaces:
Serializable, Comparable<UpdateReason>, java.lang.constant.Constable

public enum UpdateReason extends Enum<UpdateReason>
A reason why a particular path within a configuration was updated
  • Enum Constant Details

    • MISSING

      public static final UpdateReason MISSING
      Used when an option was missing, so the value was supplied with DefaultValues.ifMissing().

      The path thus represents that of the formerly missing value.

    • UPDATED

      public static final UpdateReason UPDATED
      An existing option was updated to another value.

      This typically happens when a serializer decides a better representation of the value is available, e.g. a string representation of a number is replaced with the number itself.

    • MIGRATED

      public static final UpdateReason MIGRATED
      Used in context of migrations, such as changes in the organization or format of the config.

      Potential usage:

      • A configuration entry moved to a different place.
      • A configuration entry was split up into separate options, or separate options were combined.
      • The representation of a value changed, and the new config version requires converting to the new representation. For example, changing the format of Minecraft clickable messages from legacy formatting to MiniMessage.
      • There is a path for the configuration version itself, and that version had to be updated.
    • OTHER

      public static final UpdateReason OTHER
      A catch-all for other or unknown reasons.
  • Method Details

    • values

      public static UpdateReason[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static UpdateReason valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null