Interface ApiProducer<D>

  • Type Parameters:
    D - The type of descriptor object that the producer supports.
    All Known Implementing Classes:
    CrestApiProducer

    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 Detail

      • withPath

        D withPath​(D descriptor,
                   String parentPath)
        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

        D withVersion​(D descriptor,
                      Version version)
        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

        D merge​(List<D> descriptors)
        Merge the provided descriptors into a single descriptor.
        Parameters:
        descriptors - The descriptors to be merged.
        Returns:
        The merged descriptor.
      • addApiInfo

        D addApiInfo​(D descriptor)
        Add common API Info to the descriptor.
        Parameters:
        descriptor - The descriptor.
        Returns:
        The modified descriptor.
      • newChildProducer

        ApiProducer<D> newChildProducer​(String idFragment)
        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.