Package org.projectnessie.model
Class ImmutableReferencesResponse
- java.lang.Object
-
- org.projectnessie.model.ImmutableReferencesResponse
-
- All Implemented Interfaces:
PaginatedResponse,ReferencesResponse
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableReferencesResponse extends Object implements ReferencesResponse
Immutable implementation ofReferencesResponse.Use the builder to create immutable instances:
ImmutableReferencesResponse.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableReferencesResponse.BuilderBuilds instances of typeImmutableReferencesResponse.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableReferencesResponse.Builderbuilder()Creates a builder forImmutableReferencesResponse.static ImmutableReferencesResponsecopyOf(ReferencesResponse instance)Creates an immutable copy of aReferencesResponsevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableReferencesResponsethat have equal attribute values.List<Reference>getReferences()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,references.booleanisHasMore()Whether there are more result-items than returned by this response object.StringtoString()Prints the immutable valueReferencesResponsewith attribute values.ImmutableReferencesResponsewithIsHasMore(boolean value)Copy the current immutable object by setting a value for theisHasMoreattribute.ImmutableReferencesResponsewithReferences(Iterable<? extends Reference> elements)Copy the current immutable object with elements that replace the content ofreferences.ImmutableReferencesResponsewithReferences(Reference... elements)Copy the current immutable object with elements that replace the content ofreferences.ImmutableReferencesResponsewithToken(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.
-
getReferences
public List<Reference> getReferences()
- Specified by:
getReferencesin interfaceReferencesResponse- Returns:
- The value of the
referencesattribute
-
withIsHasMore
public final ImmutableReferencesResponse 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 ImmutableReferencesResponse 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
-
withReferences
public final ImmutableReferencesResponse withReferences(Reference... elements)
Copy the current immutable object with elements that replace the content ofreferences.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withReferences
public final ImmutableReferencesResponse withReferences(Iterable<? extends Reference> elements)
Copy the current immutable object with elements that replace the content ofreferences. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of references elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableReferencesResponsethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:isHasMore,token,references.
-
toString
public String toString()
Prints the immutable valueReferencesResponsewith attribute values.
-
copyOf
public static ImmutableReferencesResponse copyOf(ReferencesResponse instance)
Creates an immutable copy of aReferencesResponsevalue. 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 ReferencesResponse instance
-
builder
public static ImmutableReferencesResponse.Builder builder()
Creates a builder forImmutableReferencesResponse.ImmutableReferencesResponse.builder() .isHasMore(boolean) // optionalisHasMore.token(String | null) // nullabletoken.addReferences|addAllReferences(org.projectnessie.model.Reference) //referenceselements .build();- Returns:
- A new ImmutableReferencesResponse builder
-
-