public class CrestApiProducer extends Object implements ApiProducer<ApiDescription>
ApiProducer
implementation for CREST resources, that provides ApiDescription
descriptors.Constructor and Description |
---|
CrestApiProducer(String id,
String apiVersion)
Construct a new producer.
|
CrestApiProducer(String id,
String apiVersion,
LocalizableString description)
Construct a new producer.
|
Modifier and Type | Method and 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.
|
public CrestApiProducer(String id, String apiVersion, LocalizableString description)
id
- The API ID fragment for this producer.apiVersion
- The version of the API being described.description
- The API description.public ApiDescription withPath(ApiDescription api, String parentPath)
ApiProducer
withPath
in interface ApiProducer<ApiDescription>
api
- The descriptor to be mutated.parentPath
- The path to add to the descriptor.public ApiDescription withVersion(ApiDescription api, Version version)
ApiProducer
withVersion
in interface ApiProducer<ApiDescription>
api
- The descriptor to be mutated.version
- The version to apply to the resource.public ApiDescription merge(List<ApiDescription> descriptions)
ApiProducer
merge
in interface ApiProducer<ApiDescription>
descriptions
- The descriptors to be merged.public ApiDescription addApiInfo(ApiDescription api)
ApiProducer
addApiInfo
in interface ApiProducer<ApiDescription>
api
- The descriptor.public ApiProducer<ApiDescription> newChildProducer(String idFragment)
ApiProducer
newChildProducer
in interface ApiProducer<ApiDescription>
idFragment
- The fragment of the ID for this producer.Copyright © 2010-2018, ForgeRock All Rights Reserved.