Enum Class Container.Mutability

java.lang.Object
java.lang.Enum<Container.Mutability>
net.orbyfied.coldlib.util.Container.Mutability
All Implemented Interfaces:
Serializable, Comparable<Container.Mutability>, Constable
Enclosing interface:
Container<V>

public static enum Container.Mutability extends Enum<Container.Mutability>
Specifies the way
  • Enum Constant Details

    • UNSUPPORTED

      public static final Container.Mutability UNSUPPORTED
      Trying to mutate the container will throw an error. It will not have any effect.
    • FORK

      public static final Container.Mutability FORK
      Trying to modify the container will fork it into a new instance with the modifications applied. No error will be thrown but the original instance won't be modified.
    • MODIFY

      public static final Container.Mutability MODIFY
      Modifications will not throw an error and go through to affect the original instance it was called on.
  • Method Details

    • values

      public static Container.Mutability[] 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 Container.Mutability 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
    • throwsError

      public boolean throwsError()
      Will the call throw an error on a container with this mutability.
      Returns:
      If it will throw.
    • modifiesInstance

      public boolean modifiesInstance()
      If a container with this mutability will modify the instance it was called on or fork/silently fail.
      Returns:
      If it will modify the instance.