Package org.forgerock.api.models
Class Action
- java.lang.Object
-
- org.forgerock.api.models.Operation
-
- org.forgerock.api.models.Action
-
- All Implemented Interfaces:
Comparable<Action>
public final class Action extends Operation implements Comparable<Action>
Class that represents the Action operation type in API descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Action.Builder
Builder class for creating the Action.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Action.Builder
action()
Creates a new builder for Action.protected void
allocateToResource(Resource.Builder resourceBuilder)
Allocates the Action operation type to the given Resource Builder.int
compareTo(Action action)
Compares two strings lexicographically.boolean
equals(Object o)
static Action
fromAnnotation(Action action, Method annotated, ApiDescription descriptor, Class<?> relativeType)
Builds an Action object using the data in the annotation.String
getName()
Getter of the ID.Schema
getRequest()
Getter of the request.Schema
getResponse()
Getter of the response.int
hashCode()
-
Methods inherited from class org.forgerock.api.models.Operation
getApiErrors, getDescription, getParameters, getStability, getSupportedLocales
-
-
-
-
Method Detail
-
getName
public String getName()
Getter of the ID.- Returns:
- Id
-
getRequest
public Schema getRequest()
Getter of the request.- Returns:
- Request
-
getResponse
public Schema getResponse()
Getter of the response.- Returns:
- Response
-
action
public static Action.Builder action()
Creates a new builder for Action.- Returns:
- New builder instance
-
allocateToResource
protected void allocateToResource(Resource.Builder resourceBuilder)
Allocates the Action operation type to the given Resource Builder.- Specified by:
allocateToResource
in classOperation
- Parameters:
resourceBuilder
- - Resource Builder to add the operation
-
fromAnnotation
public static Action fromAnnotation(Action action, Method annotated, ApiDescription descriptor, Class<?> relativeType)
Builds an Action object using the data in the annotation.- Parameters:
action
- The annotation that holds the data for the built object.annotated
- The action method.descriptor
- The root descriptor to add definitions to.relativeType
- The type relative to which schema resources should be resolved.- Returns:
- Action instance.
-
compareTo
public int compareTo(Action action)
Compares two strings lexicographically.- Specified by:
compareTo
in interfaceComparable<Action>
- Parameters:
action
- Action to compare to- Returns:
- the value
0
if the argument string is equal to this string; a value less than0
if this string is lexicographically less than the string argument; and a value greater than0
if this string is lexicographically greater than the string argument.
-
-