Package org.forgerock.api
Class CrestApiProducer
- java.lang.Object
-
- org.forgerock.api.CrestApiProducer
-
- All Implemented Interfaces:
ApiProducer<ApiDescription>
public class CrestApiProducer extends Object implements ApiProducer<ApiDescription>
AnApiProducer
implementation for CREST resources, that providesApiDescription
descriptors.
-
-
Constructor Summary
Constructors Constructor Description CrestApiProducer(String id, String apiVersion)
Construct a new producer.CrestApiProducer(String id, String apiVersion, LocalizableString description)
Construct a new producer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiDescription
addApiInfo(ApiDescription api)
Add common API Info to the descriptor.ApiDescription
merge(List<ApiDescription> descriptions)
Merge the provided descriptors into a single descriptor.ApiProducer<ApiDescription>
newChildProducer(String idFragment)
Create a child producer with the same type, but with the extra ID fragment.ApiDescription
withPath(ApiDescription api, String parentPath)
Mutate the provided descriptor to add the specified path.ApiDescription
withVersion(ApiDescription api, Version version)
Mutate the provided descriptor to add the specified version.
-
-
-
Constructor Detail
-
CrestApiProducer
public CrestApiProducer(String id, String apiVersion, LocalizableString description)
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.
-
-
Method Detail
-
withPath
public ApiDescription withPath(ApiDescription api, String parentPath)
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
public ApiDescription withVersion(ApiDescription api, Version version)
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
public ApiDescription merge(List<ApiDescription> descriptions)
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
public ApiDescription addApiInfo(ApiDescription api)
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
public ApiProducer<ApiDescription> newChildProducer(String idFragment)
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.
-
-