Package io.resys.thena.api.entities
Class ImmutablePageQuery<P>
java.lang.Object
io.resys.thena.api.entities.ImmutablePageQuery<P>
- All Implemented Interfaces:
PageQuery<P>
@Generated(from="PageQuery",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutablePageQuery<P>
extends Object
implements PageQuery<P>
Immutable implementation of
PageQuery.
Use the builder to create immutable instances:
ImmutablePageQuery.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.resys.thena.api.entities.PageQuery
PageQuery.PageSortDirection, PageQuery.PageSorting<P>, PageQuery.PageSortingOrder<P> -
Method Summary
Modifier and TypeMethodDescriptionstatic <P> ImmutablePageQuery.Builder<P> builder()Creates a builder forImmutablePageQuery.static <P> ImmutablePageQuery<P> Creates an immutable copy of aPageQueryvalue.booleanThis instance is equal to all instances ofImmutablePageQuerythat have equal attribute values.longintintgetSort()inthashCode()Computes a hash code from attributes:pageNumber,pageSize,offset,sort.toString()Prints the immutable valuePageQuerywith attribute values.final ImmutablePageQuery<P> withOffset(long value) Copy the current immutable object by setting a value for theoffsetattribute.final ImmutablePageQuery<P> withPageNumber(int value) Copy the current immutable object by setting a value for thepageNumberattribute.final ImmutablePageQuery<P> withPageSize(int value) Copy the current immutable object by setting a value for thepageSizeattribute.final ImmutablePageQuery<P> withSort(PageQuery.PageSorting<P> value) Copy the current immutable object by setting a value for thesortattribute.
-
Method Details
-
getPageNumber
public int getPageNumber()- Specified by:
getPageNumberin interfacePageQuery<P>- Returns:
- The value of the
pageNumberattribute
-
getPageSize
public int getPageSize()- Specified by:
getPageSizein interfacePageQuery<P>- Returns:
- The value of the
pageSizeattribute
-
getOffset
public long getOffset() -
getSort
-
withPageNumber
Copy the current immutable object by setting a value for thepageNumberattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pageNumber- Returns:
- A modified copy or the
thisobject
-
withPageSize
Copy the current immutable object by setting a value for thepageSizeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for pageSize- Returns:
- A modified copy or the
thisobject
-
withOffset
Copy the current immutable object by setting a value for theoffsetattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for offset- Returns:
- A modified copy or the
thisobject
-
withSort
Copy the current immutable object by setting a value for thesortattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sort- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutablePageQuerythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:pageNumber,pageSize,offset,sort. -
toString
Prints the immutable valuePageQuerywith attribute values. -
copyOf
Creates an immutable copy of aPageQueryvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
P- generic parameter P- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PageQuery instance
-
builder
Creates a builder forImmutablePageQuery.ImmutablePageQuery.<P>builder() .pageNumber(int) // requiredpageNumber.pageSize(int) // requiredpageSize.offset(long) // requiredoffset.sort(io.resys.thena.api.entities.PageQuery.PageSorting<P>) // requiredsort.build();- Type Parameters:
P- generic parameter P- Returns:
- A new ImmutablePageQuery builder
-