Class Resource.Builder

  • Enclosing class:
    Resource

    public static final class Resource.Builder
    extends Object
    Builder to help construct the Resource.
    • Constructor Detail

      • Builder

        protected Builder()
        Private default constructor.
    • Method Detail

      • reference

        public Resource.Builder reference​(Reference reference)
        Set a reference.
        Parameters:
        reference - The reference.
        Returns:
        This builder.
      • resourceSchema

        public Resource.Builder resourceSchema​(Schema resourceSchema)
        Set the resource schema.
        Parameters:
        resourceSchema - The schema of the resource for this path. Required when any of create, read, update, delete, patch are supported
        Returns:
        Builder
      • title

        public Resource.Builder title​(String title)
        Set the title.
        Parameters:
        title - Title of the endpoint
        Returns:
        Builder
      • description

        public Resource.Builder description​(LocalizableString description)
        Set the description.
        Parameters:
        description - A description of the endpoint
        Returns:
        Builder
      • description

        public Resource.Builder description​(String description)
        Set the description.
        Parameters:
        description - A description of the endpoint
        Returns:
        Builder
      • create

        public Resource.Builder create​(Create create)
        Set create.
        Parameters:
        create - The create operation description, if supported
        Returns:
        Builder
      • read

        public Resource.Builder read​(Read read)
        Set Read.
        Parameters:
        read - The read operation description, if supported
        Returns:
        Builder
      • update

        public Resource.Builder update​(Update update)
        Set Update.
        Parameters:
        update - The update operation description, if supported
        Returns:
        Builder
      • delete

        public Resource.Builder delete​(Delete delete)
        Set Delete.
        Parameters:
        delete - The delete operation description, if supported
        Returns:
        Builder
      • patch

        public Resource.Builder patch​(Patch patch)
        Set Patch.
        Parameters:
        patch - The patch operation description, if supported
        Returns:
        Builder
      • actions

        public Resource.Builder actions​(List<Action> actions)
        Set Actions.
        Parameters:
        actions - The list of action operation descriptions, if supported
        Returns:
        Builder
      • action

        public Resource.Builder action​(Action action)
        Adds one Action to the list of Actions.
        Parameters:
        action - Action operation description to be added to the list
        Returns:
        Builder
      • queries

        public Resource.Builder queries​(List<Query> queries)
        Set Queries.
        Parameters:
        queries - The list or query operation descriptions, if supported
        Returns:
        Builder
      • query

        public Resource.Builder query​(Query query)
        Adds one Query to the list of queries.
        Parameters:
        query - Query operation description to be added to the list
        Returns:
        Builder
      • subresources

        public Resource.Builder subresources​(SubResources subresources)
        Sets the sub-resources for this resource.
        Parameters:
        subresources - The sub-reosurces definition.
        Returns:
        Builder
      • operations

        public Resource.Builder operations​(Operation... operations)
        Allocates the operations given in the parameter by their type.
        Parameters:
        operations - One or more Operations
        Returns:
        Builder
      • mvccSupported

        public Resource.Builder mvccSupported​(Boolean mvccSupported)
        Setter for MVCC-supported flag.
        Parameters:
        mvccSupported - Whether this resource supports MVCC
        Returns:
        Builder
      • items

        public Resource.Builder items​(Items items)
        Adds items-resource.
        Parameters:
        items - The definition of the collection items
        Returns:
        Builder
      • parameters

        public Resource.Builder parameters​(List<Parameter> parameters)
        Set multiple supported parameters.
        Parameters:
        parameters - Extra parameters supported by the resource
        Returns:
        Builder
      • parameter

        public Resource.Builder parameter​(Parameter parameter)
        Sets a single supported parameter.
        Parameters:
        parameter - Extra parameter supported by the resource
        Returns:
        Builder
      • build

        public Resource build()
        Construct a new instance of Resource.
        Returns:
        Resource instance