Package org.forgerock.http
Interface ApiProducer<D>
- Type Parameters:
D
- The type of descriptor object that the producer supports.
- All Known Implementing Classes:
SwaggerApiProducer
public interface ApiProducer<D>
A producer of API Descriptions. The class will provide the ability to mutate existing descriptor objects in order to
amend paths and versions, and can merge a list of descriptors into one descriptor. It will also add generic
description information to a descriptor object.
-
Method Summary
Modifier and TypeMethodDescriptionaddApiInfo
(D descriptor) Add common API Info to the descriptor.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.Mutate the provided descriptor to add the specified path.withVersion
(D descriptor, Version version) Mutate the provided descriptor to add the specified version.
-
Method Details
-
withPath
Mutate the provided descriptor to add the specified path.- Parameters:
descriptor
- The descriptor to be mutated.parentPath
- The path to add to the descriptor.- Returns:
- The new descriptor.
-
withVersion
Mutate the provided descriptor to add the specified version.- Parameters:
descriptor
- The descriptor to be mutated.version
- The version to apply to the resource.- Returns:
- The new descriptor.
-
merge
Merge the provided descriptors into a single descriptor.- Parameters:
descriptors
- The descriptors to be merged.- Returns:
- The merged descriptor.
-
addApiInfo
Add common API Info to the descriptor.- Parameters:
descriptor
- The descriptor.- Returns:
- The modified descriptor.
-
newChildProducer
Create a child producer with the same type, but with the extra ID fragment.- Parameters:
idFragment
- The fragment of the ID for this producer.- Returns:
- The new producer.
-