Package com.mooltiverse.oss.nyx.services
Enum GitServiceFeature
- java.lang.Object
-
- java.lang.Enum<GitServiceFeature>
-
- com.mooltiverse.oss.nyx.services.GitServiceFeature
-
- All Implemented Interfaces:
Serializable
,Comparable<GitServiceFeature>
public enum GitServiceFeature extends Enum<GitServiceFeature>
These are the constants representing the features that may or may not be supported by providers.
When invoking an operation method against a provider and the operation is not supported then the method throws anUnsupportedOperationException
.
In order to safely know if an operation is supported you can query the service object via thesupports
method.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CUSTOM_ENDPOINT
When this feature is supported then the implementation class supports custom API endpoints (i.e.PING
When this feature is supported then the implementation class supports theGitService.ping()
method.TOKEN_AUTHENTICATION
When this feature is supported then the implementation class supports authentication with tokens (Personal Access Tokens, OAuth).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isOptional()
Returnstrue
if the feature is optional.static GitServiceFeature
valueOf(String name)
Returns the enum constant of this type with the specified name.static GitServiceFeature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TOKEN_AUTHENTICATION
public static final GitServiceFeature TOKEN_AUTHENTICATION
When this feature is supported then the implementation class supports authentication with tokens (Personal Access Tokens, OAuth).
-
CUSTOM_ENDPOINT
public static final GitServiceFeature CUSTOM_ENDPOINT
When this feature is supported then the implementation class supports custom API endpoints (i.e. for on premises installations).
-
PING
public static final GitServiceFeature PING
When this feature is supported then the implementation class supports theGitService.ping()
method.
-
-
Method Detail
-
values
public static GitServiceFeature[] 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 (GitServiceFeature c : GitServiceFeature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GitServiceFeature 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
-
isOptional
public boolean isOptional()
Returnstrue
if the feature is optional.- Returns:
true
if the feature is optional
-
-