public static final class Pagination.Builder extends Object
Pagination.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
Pagination |
build()
Builds a new
Pagination. |
Pagination.Builder |
first(Link first)
Initializes the value for the
first attribute. |
Pagination.Builder |
from(Pagination instance)
Fill a builder with attribute values from the provided
Pagination instance. |
Pagination.Builder |
last(Link last)
Initializes the value for the
last attribute. |
Pagination.Builder |
next(Link next)
Initializes the value for the
next attribute. |
Pagination.Builder |
previous(Link previous)
Initializes the value for the
previous attribute. |
Pagination.Builder |
totalPages(Integer totalPages)
Initializes the value for the
totalPages attribute. |
Pagination.Builder |
totalResults(Integer totalResults)
Initializes the value for the
totalResults attribute. |
public final Pagination.Builder from(Pagination instance)
Pagination instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final Pagination.Builder first(Link first)
first attribute.first - The value for first (can be null)this builder for use in a chained invocationpublic final Pagination.Builder last(Link last)
last attribute.last - The value for last (can be null)this builder for use in a chained invocationpublic final Pagination.Builder next(Link next)
next attribute.next - The value for next (can be null)this builder for use in a chained invocationpublic final Pagination.Builder previous(Link previous)
previous attribute.previous - The value for previous (can be null)this builder for use in a chained invocationpublic final Pagination.Builder totalPages(Integer totalPages)
totalPages attribute.totalPages - The value for totalPages (can be null)this builder for use in a chained invocationpublic final Pagination.Builder totalResults(Integer totalResults)
totalResults attribute.totalResults - The value for totalResults (can be null)this builder for use in a chained invocationpublic Pagination build()
Pagination.IllegalStateException - if any required attributes are missingCopyright © 2020. All rights reserved.