Class ResourceModel.Builder

java.lang.Object
org.glassfish.jersey.server.model.ResourceModel.Builder
Enclosing class:
ResourceModel

public static class ResourceModel.Builder extends Object
Builder used to create resource model instances.
  • Constructor Details

    • Builder

      public Builder(ResourceModel resourceModel, boolean subResourceModel)
      Create new builder pre initialized with resourceModel.
      Parameters:
      resourceModel - Resource model.
      subResourceModel - true if resource model created by this builder will be sub resource model, false if it is a application root resource model.
    • Builder

      public Builder(List<Resource> resources, boolean subResourceModel)
      Create new builder pre initialized with resource.
      Parameters:
      resources - Resources (root and non root).
      subResourceModel - true if resource model created by this builder will be sub resource model, false if it is a application root resource model.
    • Builder

      public Builder(boolean subResourceModel)
      Create new builder with empty resources.
      Parameters:
      subResourceModel - true if resource model created by this builder will be sub resource model, false if it is a application root resource model.
  • Method Details

    • addResource

      public ResourceModel.Builder addResource(Resource resource)
      Add a resource to the builder.
      Parameters:
      resource - Resource to be added to the builder (root or non root resource).
      Returns:
      Current builder.
    • build

      public ResourceModel build()
      Build the resource model. Resources with the same path are merged.
      Returns:
      Resource model.