Package org.apache.sis.metadata
Enum ModifiableMetadata.State
- All Implemented Interfaces:
Serializable
,Comparable<ModifiableMetadata.State>
,java.lang.constant.Constable
- Enclosing class:
- ModifiableMetadata
Whether the metadata is still editable or has been made final.
New
ModifiableMetadata
instances are initially EDITABLE
and can be made FINAL
after construction by a call to ModifiableMetadata.transitionTo(State)
.
Note:
more states may be added in future Apache SIS versions. On possible candidate is
STAGED
.
See SIS-81.- Since:
- 1.0
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe metadata allows missing values to be set, but does not allow existing values to be modified.The metadata is modifiable.The metadata is unmodifiable. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final byte
The numerical code associated to this enumeration value.private static final ModifiableMetadata.State[]
Mapping fromModifiableMetadata
private flags toState
enumeration. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
State
(byte code) Creates a new state associated to the given code numerical code. -
Method Summary
Modifier and TypeMethodDescription(package private) final boolean
Whether this enumeration represents a state where data cannot be modified anymore.static ModifiableMetadata.State
Returns the enum constant of this type with the specified name.static ModifiableMetadata.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
EDITABLE
The metadata is modifiable. This is the default state when newModifiableMetadata
instances are created. Note that a modifiable metadata instance does not imply that all properties contained in that instance are also editable. -
COMPLETABLE
The metadata allows missing values to be set, but does not allow existing values to be modified. This state is not appendable, i.e. it does not allow adding elements in a collection. -
FINAL
The metadata is unmodifiable. When a metadata is final, it cannot be moved back to an editable state (but it is still possible to create a modifiable copy withMetadataCopier
). Invoking any setter method on an unmodifiable metadata cause anUnmodifiableMetadataException
to be thrown.
-
-
Field Details
-
VALUES
Mapping fromModifiableMetadata
private flags toState
enumeration. A mapping exists becauseModifiableMetadata
does not use the same set of enumeration values (e.g. it has an internalModifiableMetadata.FREEZING
value), and because future versions may use a bitmask. -
code
final byte codeThe numerical code associated to this enumeration value. It serves similar purpose to theEnum.ordinal()
value, but is nevertheless provided for the reasons given inVALUES
.
-
-
Constructor Details
-
State
private State(byte code) Creates a new state associated to the given code numerical code.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
isUnmodifiable
final boolean isUnmodifiable()Whether this enumeration represents a state where data cannot be modified anymore.
-