Package org.forgerock.api.models
Class Resource
java.lang.Object
org.forgerock.api.models.Resource
Class that represents the Resource type in API descriptor.
Resource
s may be either a reference to another Resource
that will be defined elsewhere in the
API Descriptor, or a described resource. If a Reference
is provided, then none of the other fields may
be used, and if any of the other fields are used, a reference may not be provided.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The variant of the annotated type.static final class
Builder to help construct the Resource. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Resource
fromAnnotatedType
(Class<?> type, Resource.AnnotatedTypeVariant variant, ApiDescription descriptor) Build aResource
from an annotated request handler.static Resource
fromAnnotatedType
(Class<?> type, Resource.AnnotatedTypeVariant variant, Items items, ApiDescription descriptor, Parameter... extraParameters) Build aResource
from an annotated request handler.static Resource
fromAnnotatedType
(Class<?> type, Resource.AnnotatedTypeVariant variant, SubResources subResources, ApiDescription descriptor, Parameter... extraParameters) Build aResource
from an annotated request handler.Action[]
Getter of actions.Getter of Create.Getter of Delete.Getter of description.getItems()
Getter of items.Getter of the parameters array.getPatch()
Getter of Patch.Query[]
Getter of queries.getRead()
Getter of Read.Gets the reference.Getter of resource schema.Getter of sub-resources.getTitle()
Getter of title.Getter of Update.int
hashCode()
Informs if MVCC is supported.static Resource.Builder
resource()
Create a new Builder for Resoruce.toString()
-
Method Details
-
getResourceSchema
Getter of resource schema.- Returns:
- Resource schema
-
getTitle
Getter of title.- Returns:
- Title
-
getDescription
Getter of description.- Returns:
- Description
-
getCreate
Getter of Create.- Returns:
- Create
-
getRead
Getter of Read.- Returns:
- Read
-
getUpdate
Getter of Update.- Returns:
- Update
-
getDelete
Getter of Delete.- Returns:
- Delete
-
getPatch
Getter of Patch.- Returns:
- Patch
-
getActions
Getter of actions.- Returns:
- Actions
-
getQueries
Getter of queries.- Returns:
- Queries
-
getSubresources
Getter of sub-resources.- Returns:
- Sub-resources
-
getReference
Gets the reference.- Returns:
- The reference.
-
getItems
Getter of items.- Returns:
- Items
-
isMvccSupported
Informs if MVCC is supported.- Returns:
true
if MVCC is supported andfalse
otherwise
-
getParameters
Getter of the parameters array.- Returns:
- Parameters
-
equals
-
hashCode
public int hashCode() -
toString
-
resource
Create a new Builder for Resoruce.- Returns:
- Builder
-
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, ApiDescription descriptor) Build aResource
from an annotated request handler.- Parameters:
type
- The annotated type.variant
- The annotated type variant.descriptor
- The root descriptor to add definitions to.- Returns:
- The built
Resource
object.
-
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, SubResources subResources, ApiDescription descriptor, Parameter... extraParameters) Build aResource
from an annotated request handler.- Parameters:
type
- The annotated type.variant
- The annotated type variant.subResources
- The sub resources object to be included, if any sub-resources exist, or null.descriptor
- The root descriptor to add definitions to.extraParameters
- Extra parameters not from the resource annotation.- Returns:
- The built
Resource
object.
-
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, Items items, ApiDescription descriptor, Parameter... extraParameters) Build aResource
from an annotated request handler.- Parameters:
type
- The annotated type.variant
- The annotated type variant.items
- The items definition for a collection variant, or null.descriptor
- The root descriptor to add definitions to.extraParameters
- Extra parameters not from the resource annotation.- Returns:
- The built
Resource
object.
-