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>
AnApiProducerimplementation for CREST resources, that providesApiDescriptiondescriptors.
-
-
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 ApiDescriptionaddApiInfo(ApiDescription api)Add common API Info to the descriptor.ApiDescriptionmerge(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.ApiDescriptionwithPath(ApiDescription api, String parentPath)Mutate the provided descriptor to add the specified path.ApiDescriptionwithVersion(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:ApiProducerMutate the provided descriptor to add the specified path.- Specified by:
withPathin 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:ApiProducerMutate the provided descriptor to add the specified version.- Specified by:
withVersionin 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:ApiProducerMerge the provided descriptors into a single descriptor.- Specified by:
mergein interfaceApiProducer<ApiDescription>- Parameters:
descriptions- The descriptors to be merged.- Returns:
- The merged descriptor.
-
addApiInfo
public ApiDescription addApiInfo(ApiDescription api)
Description copied from interface:ApiProducerAdd common API Info to the descriptor.- Specified by:
addApiInfoin interfaceApiProducer<ApiDescription>- Parameters:
api- The descriptor.- Returns:
- The modified descriptor.
-
newChildProducer
public ApiProducer<ApiDescription> newChildProducer(String idFragment)
Description copied from interface:ApiProducerCreate a child producer with the same type, but with the extra ID fragment.- Specified by:
newChildProducerin interfaceApiProducer<ApiDescription>- Parameters:
idFragment- The fragment of the ID for this producer.- Returns:
- The new producer.
-
-