Enum ContextLifecycle
- java.lang.Object
-
- java.lang.Enum<ContextLifecycle>
-
- org.gcube.informationsystem.resourceregistry.api.rest.ContextLifecycle
-
- All Implemented Interfaces:
Serializable,Comparable<ContextLifecycle>
public enum ContextLifecycle extends Enum<ContextLifecycle>
Lifecycle slice selector for context collection reads.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringALL_WIRELowercase wire value for live + deleted contexts.static ContextLifecycleDEFAULTThe default lifecycle slice when no parameter is supplied.static StringDELETED_WIRELowercase wire value for deleted (cemetery) contexts only.static StringLIVE_WIRELowercase wire value for live contexts only (default).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContextLifecyclefromString(String s)Parses a wire value (case-insensitive).StringtoString()Returns the lowercase wire value (e.g.static ContextLifecyclevalueOf(String name)Returns the enum constant of this type with the specified name.static ContextLifecycle[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LIVE
public static final ContextLifecycle LIVE
Includes only live (non-deleted) contexts.
-
DELETED
public static final ContextLifecycle DELETED
Includes only deleted (cemetery) contexts.
-
ALL
public static final ContextLifecycle ALL
Includes both live and deleted contexts.
-
-
Field Detail
-
LIVE_WIRE
public static final String LIVE_WIRE
Lowercase wire value for live contexts only (default).- See Also:
- Constant Field Values
-
DELETED_WIRE
public static final String DELETED_WIRE
Lowercase wire value for deleted (cemetery) contexts only.- See Also:
- Constant Field Values
-
ALL_WIRE
public static final String ALL_WIRE
Lowercase wire value for live + deleted contexts.- See Also:
- Constant Field Values
-
DEFAULT
public static final ContextLifecycle DEFAULT
The default lifecycle slice when no parameter is supplied.
-
-
Method Detail
-
values
public static ContextLifecycle[] 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 (ContextLifecycle c : ContextLifecycle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ContextLifecycle 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
-
fromString
public static ContextLifecycle fromString(String s)
Parses a wire value (case-insensitive). Returnsnullfor unrecognised strings.- Parameters:
s- the wire string to parse- Returns:
- the matching
ContextLifecycle, ornullif unrecognised
-
toString
public String toString()
Returns the lowercase wire value (e.g."live").- Overrides:
toStringin classEnum<ContextLifecycle>
-
-