Package org.projectnessie.model
Class ImmutableEntriesResponse
- java.lang.Object
-
- org.projectnessie.model.ImmutableEntriesResponse
-
- All Implemented Interfaces:
EntriesResponse,PaginatedResponse
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableEntriesResponse extends Object implements EntriesResponse
Immutable implementation ofEntriesResponse.Use the builder to create immutable instances:
ImmutableEntriesResponse.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEntriesResponse.BuilderBuilds instances of typeImmutableEntriesResponse.-
Nested classes/interfaces inherited from interface org.projectnessie.model.EntriesResponse
EntriesResponse.Entry
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableEntriesResponse.Builderbuilder()Creates a builder forImmutableEntriesResponse.static ImmutableEntriesResponsecopyOf(EntriesResponse instance)Creates an immutable copy of aEntriesResponsevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableEntriesResponsethat have equal attribute values.List<EntriesResponse.Entry>getEntries()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,entries.booleanisHasMore()Whether there are more result-items than returned by this response object.StringtoString()Prints the immutable valueEntriesResponsewith attribute values.ImmutableEntriesResponsewithEntries(Iterable<? extends EntriesResponse.Entry> elements)Copy the current immutable object with elements that replace the content ofentries.ImmutableEntriesResponsewithEntries(EntriesResponse.Entry... elements)Copy the current immutable object with elements that replace the content ofentries.ImmutableEntriesResponsewithIsHasMore(boolean value)Copy the current immutable object by setting a value for theisHasMoreattribute.ImmutableEntriesResponsewithToken(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.
-
getEntries
public List<EntriesResponse.Entry> getEntries()
- Specified by:
getEntriesin interfaceEntriesResponse- Returns:
- The value of the
entriesattribute
-
withIsHasMore
public final ImmutableEntriesResponse 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 ImmutableEntriesResponse 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
-
withEntries
public final ImmutableEntriesResponse withEntries(EntriesResponse.Entry... elements)
Copy the current immutable object with elements that replace the content ofentries.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEntries
public final ImmutableEntriesResponse withEntries(Iterable<? extends EntriesResponse.Entry> elements)
Copy the current immutable object with elements that replace the content ofentries. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of entries elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableEntriesResponsethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:isHasMore,token,entries.
-
toString
public String toString()
Prints the immutable valueEntriesResponsewith attribute values.
-
copyOf
public static ImmutableEntriesResponse copyOf(EntriesResponse instance)
Creates an immutable copy of aEntriesResponsevalue. 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 EntriesResponse instance
-
builder
public static ImmutableEntriesResponse.Builder builder()
Creates a builder forImmutableEntriesResponse.ImmutableEntriesResponse.builder() .isHasMore(boolean) // optionalisHasMore.token(String | null) // nullabletoken.addEntries|addAllEntries(org.projectnessie.model.EntriesResponse.Entry) //entrieselements .build();- Returns:
- A new ImmutableEntriesResponse builder
-
-