Package net.orbyfied.coldlib.util
Enum Class Container.Mutability
- All Implemented Interfaces:
Serializable,Comparable<Container.Mutability>,Constable
Specifies the way
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTrying to modify the container will fork it into a new instance with the modifications applied.Modifications will not throw an error and go through to affect the original instance it was called on.Trying to mutate the container will throw an error. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf a container with this mutability will modify the instance it was called on or fork/silently fail.booleanWill the call throw an error on a container with this mutability.static Container.MutabilityReturns the enum constant of this class with the specified name.static Container.Mutability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNSUPPORTED
Trying to mutate the container will throw an error. It will not have any effect. -
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
Modifications will not throw an error and go through to affect the original instance it was called on.
-
-
Method Details
-
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
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 nameNullPointerException- 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.
-