Package org.forgerock.api.models
Class Query
- java.lang.Object
-
- org.forgerock.api.models.Operation
-
- org.forgerock.api.models.Query
-
- All Implemented Interfaces:
Comparable<Query>
public final class Query extends Operation implements Comparable<Query>
Class that represents the Create Operation type in API descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Query.Builder
Builder to help construct the Read.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
allocateToResource(Resource.Builder resourceBuilder)
Allocates the Query operation type to the given Resource Builder.int
compareTo(Query query)
Compares two queries.boolean
equals(Object o)
static Query
fromAnnotation(Query query, Method annotated, ApiDescription descriptor, Class<?> relativeType)
Builds a Query object from the data stored in the annotation.CountPolicy[]
getCountPolicies()
Getter of the supported paging policies.PagingMode[]
getPagingModes()
Getter of the paging modes.String[]
getQueryableFields()
Getter of the queryable fields.String
getQueryId()
Getter of the query id.String[]
getSupportedSortKeys()
Getter of the supported sort keys.QueryType
getType()
Getter of the query type.int
hashCode()
static Query.Builder
query()
Creates a new builder for Query.-
Methods inherited from class org.forgerock.api.models.Operation
getApiErrors, getDescription, getParameters, getStability, getSupportedLocales
-
-
-
-
Method Detail
-
getType
public QueryType getType()
Getter of the query type.- Returns:
- Query type num
-
getPagingModes
public PagingMode[] getPagingModes()
Getter of the paging modes.- Returns:
- Paging mode enums
-
getCountPolicies
public CountPolicy[] getCountPolicies()
Getter of the supported paging policies. If the array is empty, this means that the query does not support any form of count policy, and no value for count policy should be specified.- Returns:
- Supported paging policy enums
-
getQueryId
public String getQueryId()
Getter of the query id.- Returns:
- Query id
-
getQueryableFields
public String[] getQueryableFields()
Getter of the queryable fields.- Returns:
- Queryable fields
-
getSupportedSortKeys
public String[] getSupportedSortKeys()
Getter of the supported sort keys.- Returns:
- Supported sort keys
-
query
public static Query.Builder query()
Creates a new builder for Query.- Returns:
- New builder instance
-
allocateToResource
protected void allocateToResource(Resource.Builder resourceBuilder)
Allocates the Query operation type to the given Resource Builder.- Specified by:
allocateToResource
in classOperation
- Parameters:
resourceBuilder
- - Resource Builder to add the operation
-
fromAnnotation
public static Query fromAnnotation(Query query, Method annotated, ApiDescription descriptor, Class<?> relativeType)
Builds a Query object from the data stored in the annotation.- Parameters:
query
- The annotation that stores the data.annotated
- The method that the annotation was found on.descriptor
- The root descriptor to add definitions to.relativeType
- The type relative to which schema resources should be resolved.- Returns:
- Query instance
-
compareTo
public int compareTo(Query query)
Compares two queries.- Specified by:
compareTo
in interfaceComparable<Query>
- Parameters:
query
- Query 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.
-
-