Enum Class RecordOption

java.lang.Object
java.lang.Enum<RecordOption>
org.rostore.entity.media.RecordOption
All Implemented Interfaces:
Serializable, Comparable<RecordOption>, Constable

public enum RecordOption extends Enum<RecordOption>
Specify behaviour of the system when update or creation of key-value happens.

Needed to change some validation rules if required.

  • Enum Constant Details

    • ONLY_INSERT

      public static final RecordOption ONLY_INSERT
      Should check on the key creation if the key already exist, and if not it should not allow an operation
    • ONLY_REPLACE

      public static final RecordOption ONLY_REPLACE
      Should check if the update operation is executed on the existing key, and if not it should fail
    • OVERRIDE_VERSION

      public static final RecordOption OVERRIDE_VERSION
      This one if provided should circumvent the version-check and rewrite the version even if not correct
  • Method Details

    • values

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

      public static RecordOption valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • parse

      public static EnumSet<RecordOption> parse(String commaSeparated)
      Parses the comma-separated set of RecordOption
      Parameters:
      commaSeparated - list of options separated by the comma
      Returns:
      the enum set with the set of options from the list