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.-
Nested classes/interfaces inherited from interface org.projectnessie.model.LogResponse
LogResponse.LogEntry
-
-
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<LogResponse.LogEntry>getLogEntries()StringgetToken()Pass this value to the next invocation of the API function to get the next page of results.inthashCode()Computes a hash code from attributes:isHasMore,token,logEntries.booleanisHasMore()Whether there are more result-items than returned by this response object.StringtoString()Prints the immutable valueLogResponsewith attribute values.ImmutableLogResponsewithIsHasMore(boolean value)Copy the current immutable object by setting a value for theisHasMoreattribute.ImmutableLogResponsewithLogEntries(Iterable<? extends LogResponse.LogEntry> elements)Copy the current immutable object with elements that replace the content oflogEntries.ImmutableLogResponsewithLogEntries(LogResponse.LogEntry... elements)Copy the current immutable object with elements that replace the content oflogEntries.ImmutableLogResponsewithToken(String value)Copy the current immutable object by setting a value for thetokenattribute.
-
-
-
Method Detail
-
isHasMore
public boolean isHasMore()
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:
isHasMorein 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 continuation token for the next invocation of an API function taking a subclass
of
AbstractParams, ifisHasMore()istrue. Undefined, ifisHasMore()isfalse.
-
getLogEntries
public List<LogResponse.LogEntry> getLogEntries()
- Specified by:
getLogEntriesin interfaceLogResponse- Returns:
- The value of the
logEntriesattribute
-
withIsHasMore
public final ImmutableLogResponse withIsHasMore(boolean value)
Copy the current immutable object by setting a value for theisHasMoreattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isHasMore- 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
-
withLogEntries
public final ImmutableLogResponse withLogEntries(LogResponse.LogEntry... elements)
Copy the current immutable object with elements that replace the content oflogEntries.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withLogEntries
public final ImmutableLogResponse withLogEntries(Iterable<? extends LogResponse.LogEntry> elements)
Copy the current immutable object with elements that replace the content oflogEntries. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of logEntries 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()
Computes a hash code from attributes:isHasMore,token,logEntries.
-
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() .isHasMore(boolean) // optionalisHasMore.token(String | null) // nullabletoken.addLogEntries|addAllLogEntries(org.projectnessie.model.LogResponse.LogEntry) //logEntrieselements .build();- Returns:
- A new ImmutableLogResponse builder
-
-