Enum State
- java.lang.Object
-
- java.lang.Enum<State>
-
- de.aristaflow.adept2.model.common.State
-
- All Implemented Interfaces:
Serializable,Comparable<State>
public enum State extends Enum<State>
A state specifies how an entity of the activity model (ExecutableComponentDescription,Operation,ConfigurationSetandActivityTemplateDefinition) may be used. Entities (more precisely their revision)IN_DEVELOPMENTmay only be used for testing purpose. They are separated from the other entities in so-called development branches. Such a development branch may be released any time (if no conflicts occur). This sets the corresponding entity in stateIN_PRODUCTIONand all former revisions toOUTDATED. The corresponding entity may then be used normally unless set toOUTDATEDwhich is allowed any time.
By creating a new development branch, no entity is set toIN_DEVELOPMENTat first. This will happen as soon as one entity is retrieved and changed. Internally this creates a copy of the latest revision in the corresponding slot.This way you can have branches for the entitites currently under development but the revisions
IN_PRODUCTIONare strictly flat.- Author:
- Ulrich Kreher
-
-
Enum Constant Summary
Enum Constants Enum Constant Description IN_DEVELOPMENTWhile beingUNDER_CONSTRUTION, the corresponding entity is subject of changes with respect to the corresponding base revision.IN_PRODUCTIONWhile beingIN_PRODUCTION, the corresponding entity may be used normally.OUTDATEDOUTDATEDis the last state in the lifecycle of (the revision of) an entity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetCode()Returns a byte code representing this state.static StatevalueOf(byte code)Returns the state for the given code ornullif the code is not recognised.static StatevalueOf(String name)Returns the enum constant of this type with the specified name.static State[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IN_DEVELOPMENT
public static final State IN_DEVELOPMENT
While beingUNDER_CONSTRUTION, the corresponding entity is subject of changes with respect to the corresponding base revision. Such entities may only be used for local tests but not for the production system.IN_DEVELOPMENTof an entity having no released revision yet has a special semantics: This is the only revision which allows to change the names ofExecutableComponentDescriptions,Operations andConfigurationSets. Since this name is used as unique identifier in the production system, it may not be changed when beingIN_PRODUCTIONand therefore not in the following revisions.
-
IN_PRODUCTION
public static final State IN_PRODUCTION
While beingIN_PRODUCTION, the corresponding entity may be used normally. As soon as a new revision is set toIN_PRODUCTION, the state of the current revision automatically changes toOUTDATED. Besides this, the current revision may be explicitly set toOUTDATED.
-
OUTDATED
public static final State OUTDATED
OUTDATEDis the last state in the lifecycle of (the revision of) an entity. Such an entity may not be used any more. This state is either set explicitly or implicitly when a new revision is set toIN_PRODUCTION. However, the latest revision of an entity may be outdated but it will still be the base for new development branches.
-
-
Method Detail
-
values
public static State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (State c : State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static State valueOf(String name)
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
-
getCode
public byte getCode()
Returns a byte code representing this state. This code is resilient to reordering or renaming the enum constants.- Returns:
- a byte code representing this state
-
valueOf
public static State valueOf(byte code)
Returns the state for the given code ornullif the code is not recognised.- Parameters:
code- the code for which to find the state- Returns:
- the state for the given code
-
-