Package com.spotify.github.v3.git
Class ImmutableTree
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableTree
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTree extends Object implements Tree
Immutable implementation ofTree.Use the builder to create immutable instances:
ImmutableTree.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTree.BuilderBuilds instances of typeImmutableTree.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTree.Builderbuilder()Creates a builder forImmutableTree.static ImmutableTreecopyOf(Tree instance)Creates an immutable copy of aTreevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTreethat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,url,tree,truncated.Stringsha()SHA.StringtoString()Prints the immutable valueTreewith attribute values.List<TreeItem>tree()Tree items.Booleantruncated()If true, the number of items in the tree array exceeded our maximum limit.URIurl()URL.ImmutableTreewithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableTreewithTree(TreeItem... elements)Copy the current immutable object with elements that replace the content oftree.ImmutableTreewithTree(Iterable<? extends TreeItem> elements)Copy the current immutable object with elements that replace the content oftree.ImmutableTreewithTruncated(Boolean value)Copy the current immutable object by setting a value for thetruncatedattribute.ImmutableTreewithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
truncated
@Nullable public Boolean truncated()
If true, the number of items in the tree array exceeded our maximum limit.
-
withSha
public final ImmutableTree withSha(@Nullable String value)
Copy the current immutable object by setting a value for theshaattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sha (can benull)- Returns:
- A modified copy of the
thisobject
-
withUrl
public final ImmutableTree withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
withTree
public final ImmutableTree withTree(@Nullable TreeItem... elements)
Copy the current immutable object with elements that replace the content oftree.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTree
public final ImmutableTree withTree(@Nullable Iterable<? extends TreeItem> elements)
Copy the current immutable object with elements that replace the content oftree. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tree elements to set- Returns:
- A modified copy of
thisobject
-
withTruncated
public final ImmutableTree withTruncated(@Nullable Boolean value)
Copy the current immutable object by setting a value for thetruncatedattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for truncated (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableTreethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha,url,tree,truncated.
-
toString
public String toString()
Prints the immutable valueTreewith attribute values.
-
copyOf
public static ImmutableTree copyOf(Tree instance)
Creates an immutable copy of aTreevalue. 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 Tree instance
-
builder
public static ImmutableTree.Builder builder()
Creates a builder forImmutableTree.ImmutableTree.builder() .sha(String | null) // nullablesha.url(java.net.URI | null) // nullableurl.tree(List<com.spotify.github.v3.git.TreeItem> | null) // nullabletree.truncated(Boolean | null) // nullabletruncated.build();- Returns:
- A new ImmutableTree builder
-
-