Class ImmutablePaginatedDto<PAGINATED_OBJECT>
- java.lang.Object
-
- com.chutneytesting.server.core.domain.tools.ImmutablePaginatedDto<PAGINATED_OBJECT>
-
- All Implemented Interfaces:
PaginatedDto<PAGINATED_OBJECT>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePaginatedDto<PAGINATED_OBJECT> extends Object implements PaginatedDto<PAGINATED_OBJECT>
Immutable implementation ofPaginatedDto.Use the builder to create immutable instances:
ImmutablePaginatedDto.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePaginatedDto.Builder<PAGINATED_OBJECT>Builds instances of typeImmutablePaginatedDto.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <PAGINATED_OBJECT>
ImmutablePaginatedDto.Builder<PAGINATED_OBJECT>builder()Creates a builder forImmutablePaginatedDto.static <PAGINATED_OBJECT>
ImmutablePaginatedDto<PAGINATED_OBJECT>copyOf(PaginatedDto<PAGINATED_OBJECT> instance)Creates an immutable copy of aPaginatedDtovalue.List<PAGINATED_OBJECT>data()booleanequals(Object another)This instance is equal to all instances ofImmutablePaginatedDtothat have equal attribute values.inthashCode()Computes a hash code from attributes:totalCount,data.StringtoString()Prints the immutable valuePaginatedDtowith attribute values.longtotalCount()ImmutablePaginatedDto<PAGINATED_OBJECT>withData(Iterable<? extends PAGINATED_OBJECT> elements)Copy the current immutable object with elements that replace the content ofdata.ImmutablePaginatedDto<PAGINATED_OBJECT>withData(PAGINATED_OBJECT... elements)Copy the current immutable object with elements that replace the content ofdata.ImmutablePaginatedDto<PAGINATED_OBJECT>withTotalCount(long value)Copy the current immutable object by setting a value for thetotalCountattribute.
-
-
-
Method Detail
-
totalCount
public long totalCount()
- Specified by:
totalCountin interfacePaginatedDto<PAGINATED_OBJECT>- Returns:
- The value of the
totalCountattribute
-
data
public List<PAGINATED_OBJECT> data()
- Specified by:
datain interfacePaginatedDto<PAGINATED_OBJECT>- Returns:
- The value of the
dataattribute
-
withTotalCount
public final ImmutablePaginatedDto<PAGINATED_OBJECT> withTotalCount(long value)
Copy the current immutable object by setting a value for thetotalCountattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for totalCount- Returns:
- A modified copy of the
thisobject
-
withData
@SafeVarargs public final ImmutablePaginatedDto<PAGINATED_OBJECT> withData(PAGINATED_OBJECT... elements)
Copy the current immutable object with elements that replace the content ofdata.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withData
public final ImmutablePaginatedDto<PAGINATED_OBJECT> withData(Iterable<? extends PAGINATED_OBJECT> elements)
Copy the current immutable object with elements that replace the content ofdata. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of data elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePaginatedDtothat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:totalCount,data.
-
toString
public String toString()
Prints the immutable valuePaginatedDtowith attribute values.
-
copyOf
public static <PAGINATED_OBJECT> ImmutablePaginatedDto<PAGINATED_OBJECT> copyOf(PaginatedDto<PAGINATED_OBJECT> instance)
Creates an immutable copy of aPaginatedDtovalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
PAGINATED_OBJECT- generic parameter PAGINATED_OBJECT- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PaginatedDto instance
-
builder
public static <PAGINATED_OBJECT> ImmutablePaginatedDto.Builder<PAGINATED_OBJECT> builder()
Creates a builder forImmutablePaginatedDto.ImmutablePaginatedDto.<PAGINATED_OBJECT>builder() .totalCount(long) // requiredtotalCount.addData|addAllData(PAGINATED_OBJECT) //dataelements .build();- Type Parameters:
PAGINATED_OBJECT- generic parameter PAGINATED_OBJECT- Returns:
- A new ImmutablePaginatedDto builder
-
-