Class ImmutablePaginationRequestWrapperDto<W>

java.lang.Object
fr.enedis.chutney.server.core.domain.tools.ImmutablePaginationRequestWrapperDto<W>
All Implemented Interfaces:
PaginationRequestWrapperDto<W>

@Generated(from="PaginationRequestWrapperDto", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePaginationRequestWrapperDto<W> extends Object implements PaginationRequestWrapperDto<W>
Immutable implementation of PaginationRequestWrapperDto.

Use the builder to create immutable instances: ImmutablePaginationRequestWrapperDto.builder().

  • Method Details

    • pageNumber

      public Integer pageNumber()
      Specified by:
      pageNumber in interface PaginationRequestWrapperDto<W>
      Returns:
      The value of the pageNumber attribute
    • elementPerPage

      public Integer elementPerPage()
      Specified by:
      elementPerPage in interface PaginationRequestWrapperDto<W>
      Returns:
      The value of the elementPerPage attribute
    • wrappedRequest

      public Optional<W> wrappedRequest()
      Specified by:
      wrappedRequest in interface PaginationRequestWrapperDto<W>
      Returns:
      The value of the wrappedRequest attribute
    • withPageNumber

      public final ImmutablePaginationRequestWrapperDto<W> withPageNumber(Integer value)
      Copy the current immutable object by setting a value for the pageNumber attribute. An equals check 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
    • withElementPerPage

      public final ImmutablePaginationRequestWrapperDto<W> withElementPerPage(Integer value)
      Copy the current immutable object by setting a value for the elementPerPage attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for elementPerPage
      Returns:
      A modified copy or the this object
    • withWrappedRequest

      public final ImmutablePaginationRequestWrapperDto<W> withWrappedRequest(Optional<W> value)
      Copy the current immutable object by setting a value for the wrappedRequest attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for wrappedRequest
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePaginationRequestWrapperDto 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, elementPerPage, wrappedRequest.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <W> ImmutablePaginationRequestWrapperDto<W> copyOf(PaginationRequestWrapperDto<W> instance)
      Creates an immutable copy of a PaginationRequestWrapperDto 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:
      W - generic parameter W
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable PaginationRequestWrapperDto instance
    • builder

      public static <W> ImmutablePaginationRequestWrapperDto.Builder<W> builder()
      Creates a builder for ImmutablePaginationRequestWrapperDto.
       ImmutablePaginationRequestWrapperDto.<W>builder()
          .pageNumber(Integer) // required pageNumber
          .elementPerPage(Integer) // required elementPerPage
          .wrappedRequest(Optional<W>) // optional wrappedRequest
          .build();
       
      Type Parameters:
      W - generic parameter W
      Returns:
      A new ImmutablePaginationRequestWrapperDto builder