Package org.forgerock.api
Class CrestApiProducer
java.lang.Object
org.forgerock.api.CrestApiProducer
- All Implemented Interfaces:
ApiProducer<ApiDescription>
An
ApiProducer
implementation for CREST resources, that provides ApiDescription
descriptors.-
Constructor Summary
ConstructorDescriptionCrestApiProducer
(String id, String apiVersion) Construct a new producer.CrestApiProducer
(String id, String apiVersion, LocalizableString description) Construct a new producer. -
Method Summary
Modifier and TypeMethodDescriptionaddApiInfo
(ApiDescription api) Add common API Info to the descriptor.merge
(List<ApiDescription> descriptions) Merge the provided descriptors into a single descriptor.newChildProducer
(String idFragment) Create a child producer with the same type, but with the extra ID fragment.withPath
(ApiDescription api, String parentPath) Mutate the provided descriptor to add the specified path.withVersion
(ApiDescription api, Version version) Mutate the provided descriptor to add the specified version.
-
Constructor Details
-
CrestApiProducer
Construct a new producer.- Parameters:
id
- The API ID fragment for this producer.apiVersion
- The version of the API being described.description
- The API description.
-
CrestApiProducer
Construct a new producer.- Parameters:
id
- The API ID fragment for this producer.apiVersion
- The version of the API being described.
-
-
Method Details
-
withPath
Description copied from interface:ApiProducer
Mutate the provided descriptor to add the specified path.- Specified by:
withPath
in interfaceApiProducer<ApiDescription>
- Parameters:
api
- The descriptor to be mutated.parentPath
- The path to add to the descriptor.- Returns:
- The new descriptor.
-
withVersion
Description copied from interface:ApiProducer
Mutate the provided descriptor to add the specified version.- Specified by:
withVersion
in interfaceApiProducer<ApiDescription>
- Parameters:
api
- The descriptor to be mutated.version
- The version to apply to the resource.- Returns:
- The new descriptor.
-
merge
Description copied from interface:ApiProducer
Merge the provided descriptors into a single descriptor.- Specified by:
merge
in interfaceApiProducer<ApiDescription>
- Parameters:
descriptions
- The descriptors to be merged.- Returns:
- The merged descriptor.
-
addApiInfo
Description copied from interface:ApiProducer
Add common API Info to the descriptor.- Specified by:
addApiInfo
in interfaceApiProducer<ApiDescription>
- Parameters:
api
- The descriptor.- Returns:
- The modified descriptor.
-
newChildProducer
Description copied from interface:ApiProducer
Create a child producer with the same type, but with the extra ID fragment.- Specified by:
newChildProducer
in interfaceApiProducer<ApiDescription>
- Parameters:
idFragment
- The fragment of the ID for this producer.- Returns:
- The new producer.
-