Enum ResultScope
- java.lang.Object
-
- java.lang.Enum<ResultScope>
-
- org.gcube.informationsystem.resourceregistry.api.rest.ResultScope
-
- All Implemented Interfaces:
Serializable,Comparable<ResultScope>
public enum ResultScope extends Enum<ResultScope>
Normative tokens emitted within theX-Result-Scoperesponse header, signalling that a successful response was intentionally filtered or expanded beyond the standard base URI scope.The wire format uses lowercase, kebab-case values (e.g.
"state-filtered"). UsetoString()to obtain the wire value andfromString(String)for case-insensitive parsing. Multiple scopes are combined into a single header value as a comma-separated list (e.g."hierarchical,state-filtered"); clients should split on commas, trim whitespace, and evaluate each token independently, ignoring order.See
appendix/09-result-scope-conventions.mdin the reference documentation for the full normative contract, including combination rules and examples. Declaration order below matches the canonical ordering used throughout that document (hierarchical,state-filtered,previous-path).- Author:
- Luca Frosini (ISTI - CNR)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description HIERARCHICALThe request was evaluated over the token Context and its descendants (hierarchical=true).PREVIOUS_PATHSuccess is based on token resolution via a historical previous path rather than current path.STATE_FILTEREDResponse omits instances or Context memberships, or a hierarchical write skipped descendant Contexts, because theeffectiveStateof their Context is notACTIVE.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResultScopefromString(String s)Parses a single wire token (case-insensitive).StringtoString()Returns the lowercase, kebab-case wire token (e.g.static ResultScopevalueOf(String name)Returns the enum constant of this type with the specified name.static ResultScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HIERARCHICAL
public static final ResultScope HIERARCHICAL
The request was evaluated over the token Context and its descendants (hierarchical=true).
-
STATE_FILTERED
public static final ResultScope STATE_FILTERED
Response omits instances or Context memberships, or a hierarchical write skipped descendant Contexts, because theeffectiveStateof their Context is notACTIVE.
-
PREVIOUS_PATH
public static final ResultScope PREVIOUS_PATH
Success is based on token resolution via a historical previous path rather than current path.
-
-
Method Detail
-
values
public static ResultScope[] 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 (ResultScope c : ResultScope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResultScope 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 ResultScope fromString(String s)
Parses a single wire token (case-insensitive). Returnsnullfor unrecognised strings.- Parameters:
s- the wire token to parse (e.g."state-filtered")- Returns:
- the matching
ResultScope, ornullif unrecognised
-
toString
public String toString()
Returns the lowercase, kebab-case wire token (e.g."state-filtered").- Overrides:
toStringin classEnum<ResultScope>
-
-