Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LIMIT
The default limit used for pagination
|
static Pagination |
DEFAULT_PAGINATION
The default pagination used for
SiteQuery 's with a limit set to DEFAULT_LIMIT |
static SiteType |
DEFAULT_SITE_TYPE
Default site type used to build SiteQuery's if one is not defined.
|
Constructor and Description |
---|
SiteQuery.Builder() |
Modifier and Type | Method and Description |
---|---|
SiteQuery.Builder |
ascending()
Sets the order of the sorting object of this builder to
Sorting.Order.ascending |
SiteQuery |
build()
Creates a new SiteQuery object represented by the state this builder
|
SiteQuery.Builder |
descending()
Sets the order of the sorting object of this builder to
Sorting.Order.descending |
SiteQuery.Builder |
from(SiteQuery query)
Creates a new builder from an existing SiteQuery.
|
SiteQuery.Builder |
includeEmptySites(boolean emptySites) |
SiteQuery.Builder |
withAllSiteTypes()
Sets the site type's of this builder to include all
SiteType 's |
SiteQuery.Builder |
withFilter(Filter<Site> filter)
Sets the filter for this builder
|
SiteQuery.Builder |
withNextPage()
Sets the pagination of this builder to
pagination.getNext() if it's not null. |
SiteQuery.Builder |
withPagination(int offset,
int limit)
Sets the pagination object of this builder to use the specified offset and limit.
|
SiteQuery.Builder |
withPagination(Pagination pagination)
Sets the pagination object of this builder
|
SiteQuery.Builder |
withPreviousPage()
Sets the pagination of this builder to
pagination.getPrevious() if it's not null. |
SiteQuery.Builder |
withSiteTypes(EnumSet<SiteType> siteTypes)
Sets the site types of this builder.
|
SiteQuery.Builder |
withSiteTypes(SiteType first,
SiteType... rest)
Sets the site types of this builder
|
SiteQuery.Builder |
withSorting(Sorting<Site> sorting)
Sets the sorting object for this builder
|
public static final int DEFAULT_LIMIT
public static final Pagination DEFAULT_PAGINATION
SiteQuery
's with a limit set to DEFAULT_LIMIT
public static final SiteType DEFAULT_SITE_TYPE
public SiteQuery.Builder withSiteTypes(SiteType first, SiteType... rest)
first
- the site type this builder is to containrest
- the remaining site type's this builder is to containpublic SiteQuery.Builder withSiteTypes(EnumSet<SiteType> siteTypes)
siteTypes
- the set of siteTypes to set for this builder.public SiteQuery.Builder withAllSiteTypes()
SiteType
'spublic SiteQuery.Builder includeEmptySites(boolean emptySites)
SiteQuery.isIncludeEmptySites()
public SiteQuery.Builder withPagination(int offset, int limit)
offset
- the offset of the paginationlimit
- the limit of the paginationpublic SiteQuery.Builder withPagination(Pagination pagination)
pagination
- the pagination objectpublic SiteQuery.Builder withNextPage()
pagination.getNext()
if it's not null.public SiteQuery.Builder withPreviousPage()
pagination.getPrevious()
if it's not null.public SiteQuery.Builder withFilter(Filter<Site> filter)
filter
- the filterpublic SiteQuery.Builder withSorting(Sorting<Site> sorting)
sorting
- the sorting objectpublic SiteQuery.Builder ascending()
Sorting.Order.ascending
public SiteQuery.Builder descending()
Sorting.Order.descending
public SiteQuery build()
public SiteQuery.Builder from(SiteQuery query)
query
- the query used to build the initial state of the builderCopyright © 2013 JBoss by Red Hat. All Rights Reserved.