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().

  • Method Details

    • getPageNumber

      public int getPageNumber()
      Specified by:
      getPageNumber in interface PageQuery<P>
      Returns:
      The value of the pageNumber attribute
    • getPageSize

      public int getPageSize()
      Specified by:
      getPageSize in interface PageQuery<P>
      Returns:
      The value of the pageSize attribute
    • getOffset

      public long getOffset()
      Specified by:
      getOffset in interface PageQuery<P>
      Returns:
      The value of the offset attribute
    • getSort

      public PageQuery.PageSorting<P> getSort()
      Specified by:
      getSort in interface PageQuery<P>
      Returns:
      The value of the sort attribute
    • withPageNumber

      public final ImmutablePageQuery<P> withPageNumber(int value)
      Copy the current immutable object by setting a value for the pageNumber attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for pageNumber
      Returns:
      A modified copy or the this object
    • withPageSize

      public final ImmutablePageQuery<P> withPageSize(int value)
      Copy the current immutable object by setting a value for the pageSize attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for pageSize
      Returns:
      A modified copy or the this object
    • withOffset

      public final ImmutablePageQuery<P> withOffset(long value)
      Copy the current immutable object by setting a value for the offset attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for offset
      Returns:
      A modified copy or the this object
    • withSort

      public final ImmutablePageQuery<P> withSort(PageQuery.PageSorting<P> value)
      Copy the current immutable object by setting a value for the sort attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sort
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutablePageQuery that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: pageNumber, pageSize, offset, sort.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value PageQuery with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static <P> ImmutablePageQuery<P> copyOf(PageQuery<P> instance)
      Creates an immutable copy of a PageQuery value. 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

      public static <P> ImmutablePageQuery.Builder<P> builder()
      Creates a builder for ImmutablePageQuery.
       ImmutablePageQuery.<P>builder()
          .pageNumber(int) // required pageNumber
          .pageSize(int) // required pageSize
          .offset(long) // required offset
          .sort(io.resys.thena.api.entities.PageQuery.PageSorting<P>) // required sort
          .build();
       
      Type Parameters:
      P - generic parameter P
      Returns:
      A new ImmutablePageQuery builder