Package org.forgerock.api.models
Class Resource
- java.lang.Object
-
- org.forgerock.api.models.Resource
-
public final class Resource extends Object
Class that represents the Resource type in API descriptor.Resource
s may be either a reference to anotherResource
that will be defined elsewhere in the API Descriptor, or a described resource. If aReference
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
Nested Classes Modifier and Type Class Description static class
Resource.AnnotatedTypeVariant
The variant of the annotated type.static class
Resource.Builder
Builder to help construct the Resource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
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[]
getActions()
Getter of actions.Create
getCreate()
Getter of Create.Delete
getDelete()
Getter of Delete.LocalizableString
getDescription()
Getter of description.Items
getItems()
Getter of items.Parameter[]
getParameters()
Getter of the parameters array.Patch
getPatch()
Getter of Patch.Query[]
getQueries()
Getter of queries.Read
getRead()
Getter of Read.Reference
getReference()
Gets the reference.Schema
getResourceSchema()
Getter of resource schema.SubResources
getSubresources()
Getter of sub-resources.LocalizableString
getTitle()
Getter of title.Update
getUpdate()
Getter of Update.int
hashCode()
Boolean
isMvccSupported()
Informs if MVCC is supported.static Resource.Builder
resource()
Create a new Builder for Resoruce.String
toString()
-
-
-
Method Detail
-
getResourceSchema
public Schema getResourceSchema()
Getter of resource schema.- Returns:
- Resource schema
-
getTitle
public LocalizableString getTitle()
Getter of title.- Returns:
- Title
-
getDescription
public LocalizableString getDescription()
Getter of description.- Returns:
- Description
-
getCreate
public Create getCreate()
Getter of Create.- Returns:
- Create
-
getRead
public Read getRead()
Getter of Read.- Returns:
- Read
-
getUpdate
public Update getUpdate()
Getter of Update.- Returns:
- Update
-
getDelete
public Delete getDelete()
Getter of Delete.- Returns:
- Delete
-
getPatch
public Patch getPatch()
Getter of Patch.- Returns:
- Patch
-
getActions
public Action[] getActions()
Getter of actions.- Returns:
- Actions
-
getQueries
public Query[] getQueries()
Getter of queries.- Returns:
- Queries
-
getSubresources
public SubResources getSubresources()
Getter of sub-resources.- Returns:
- Sub-resources
-
getReference
public Reference getReference()
Gets the reference.- Returns:
- The reference.
-
getItems
public Items getItems()
Getter of items.- Returns:
- Items
-
isMvccSupported
public Boolean isMvccSupported()
Informs if MVCC is supported.- Returns:
true
if MVCC is supported andfalse
otherwise
-
getParameters
public Parameter[] getParameters()
Getter of the parameters array.- Returns:
- Parameters
-
resource
public static Resource.Builder 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.
-
-