Package org.projectnessie.model
Class ImmutableLogResponse
- java.lang.Object
-
- org.projectnessie.model.ImmutableLogResponse
-
- All Implemented Interfaces:
LogResponse,PaginatedResponse
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableLogResponse extends Object implements LogResponse
Immutable implementation ofLogResponse.Use the builder to create immutable instances:
ImmutableLogResponse.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableLogResponse.BuilderBuilds instances of typeImmutableLogResponse.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLogResponse.Builderbuilder()Creates a builder forImmutableLogResponse.static ImmutableLogResponsecopyOf(LogResponse instance)Creates an immutable copy of aLogResponsevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableLogResponsethat have equal attribute values.List<CommitMeta>getOperations()StringgetToken()Pass this value to the next invocation of the API function to get the next page of results.inthashCode()Returns a precomputed-on-construction hash code from attributes:hasMore,token,operations.booleanhasMore()Whether there are more result-items than returned by this response object.StringtoString()Prints the immutable valueLogResponsewith attribute values.ImmutableLogResponsewithHasMore(boolean value)Copy the current immutable object by setting a value for thehasMoreattribute.ImmutableLogResponsewithOperations(Iterable<? extends CommitMeta> elements)Copy the current immutable object with elements that replace the content ofoperations.ImmutableLogResponsewithOperations(CommitMeta... elements)Copy the current immutable object with elements that replace the content ofoperations.ImmutableLogResponsewithToken(String value)Copy the current immutable object by setting a value for thetokenattribute.
-
-
-
Method Detail
-
hasMore
public boolean hasMore()
Whether there are more result-items than returned by this response object.If there are more result-items, the value returned by
getToken()can be used in the next invocation to get the next "page" of results.- Specified by:
hasMorein interfacePaginatedResponse- Returns:
true, if there are more result items.
-
getToken
@Nullable public String getToken()
Pass this value to the next invocation of the API function to get the next page of results.Paging tokens are opaque and the structure may change without prior notice even in patch releases.
- Specified by:
getTokenin interfacePaginatedResponse- Returns:
- paging-token for the next invocation of an API function, if
hasMore()istrue. Undefined, ifhasMore()isfalse.
-
getOperations
public List<CommitMeta> getOperations()
- Specified by:
getOperationsin interfaceLogResponse- Returns:
- The value of the
operationsattribute
-
withHasMore
public final ImmutableLogResponse withHasMore(boolean value)
Copy the current immutable object by setting a value for thehasMoreattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hasMore- Returns:
- A modified copy of the
thisobject
-
withToken
public final ImmutableLogResponse withToken(@Nullable String value)
Copy the current immutable object by setting a value for thetokenattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for token (can benull)- Returns:
- A modified copy of the
thisobject
-
withOperations
public final ImmutableLogResponse withOperations(CommitMeta... elements)
Copy the current immutable object with elements that replace the content ofoperations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withOperations
public final ImmutableLogResponse withOperations(Iterable<? extends CommitMeta> elements)
Copy the current immutable object with elements that replace the content ofoperations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of operations elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableLogResponsethat have equal attribute values.
-
hashCode
public int hashCode()
Returns a precomputed-on-construction hash code from attributes:hasMore,token,operations.
-
toString
public String toString()
Prints the immutable valueLogResponsewith attribute values.
-
copyOf
public static ImmutableLogResponse copyOf(LogResponse instance)
Creates an immutable copy of aLogResponsevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable LogResponse instance
-
builder
public static ImmutableLogResponse.Builder builder()
Creates a builder forImmutableLogResponse.ImmutableLogResponse.builder() .hasMore(boolean) // optionalhasMore.token(String | null) // nullabletoken.addOperations|addAllOperations(org.projectnessie.model.CommitMeta) //operationselements .build();- Returns:
- A new ImmutableLogResponse builder
-
-