Enum Class DeleteAction

java.lang.Object
java.lang.Enum<DeleteAction>
io.permazen.core.DeleteAction
All Implemented Interfaces:
Serializable, Comparable<DeleteAction>, Constable

public enum DeleteAction extends Enum<DeleteAction>
Describes what action to take when an object that is still referred to by some other object is deleted.
See Also:
  • Enum Constant Details

    • IGNORE

      public static final DeleteAction IGNORE
      Do nothing. The reference will still exist, but subsequent attempts to access the fields of the deleted object will result in DeletedObjectException.
    • EXCEPTION

      public static final DeleteAction EXCEPTION
      Disallow deleting the object, instead throwing ReferencedObjectException. This is the default if not specified.

      Note: deleting an object that is only referred to by itself will not cause any exception to be thrown.

    • UNREFERENCE

      public static final DeleteAction UNREFERENCE
      Remove the reference, either by setting it to null (in the case of a SimpleField in an object), or by removing the corresponding collection element or map entry (in the case of a ComplexField sub-field).
    • DELETE

      public static final DeleteAction DELETE
      Also delete the object containing the reference. This action will be repeated recursively, if necessary.
  • Method Details

    • values

      public static DeleteAction[] 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 DeleteAction 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