org.glassfish.jersey.server.model

## 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 Summary

Constructors
Constructor and Description
`Builder(boolean subResourceModel)` Create new builder with empty resources.
`Builder(List<Resource> resources, boolean subResourceModel)` Create new builder pre initialized with `resource`.
`Builder(ResourceModel resourceModel, boolean subResourceModel)` Create new builder pre initialized with `resourceModel`.

### Method Summary

All Methods Instance Methods Concrete Methods
`ResourceModel.Builder` `addResource(Resource resource)` Add a resource to the builder.
`ResourceModel` `build()` Build the `resource model`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### 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 Detail

#### 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.