Class ImmutablePageQuery.Builder<P>

java.lang.Object
io.resys.thena.api.entities.ImmutablePageQuery.Builder<P>
Enclosing class:
ImmutablePageQuery<P>

@Generated(from="PageQuery", generator="Immutables") public static final class ImmutablePageQuery.Builder<P> extends Object
Builds instances of type ImmutablePageQuery. 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.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutablePageQuery.Builder<P> from(PageQuery<P> instance)
      Fill a builder with attribute values from the provided PageQuery instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • pageNumber

      @CanIgnoreReturnValue public final ImmutablePageQuery.Builder<P> pageNumber(int pageNumber)
      Initializes the value for the pageNumber attribute.
      Parameters:
      pageNumber - The value for pageNumber
      Returns:
      this builder for use in a chained invocation
    • pageSize

      @CanIgnoreReturnValue public final ImmutablePageQuery.Builder<P> pageSize(int pageSize)
      Initializes the value for the pageSize attribute.
      Parameters:
      pageSize - The value for pageSize
      Returns:
      this builder for use in a chained invocation
    • offset

      @CanIgnoreReturnValue public final ImmutablePageQuery.Builder<P> offset(long offset)
      Initializes the value for the offset attribute.
      Parameters:
      offset - The value for offset
      Returns:
      this builder for use in a chained invocation
    • sort

      @CanIgnoreReturnValue public final ImmutablePageQuery.Builder<P> sort(PageQuery.PageSorting<P> sort)
      Initializes the value for the sort attribute.
      Parameters:
      sort - The value for sort
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePageQuery<P> build()
      Builds a new ImmutablePageQuery.
      Returns:
      An immutable instance of PageQuery
      Throws:
      IllegalStateException - if any required attributes are missing