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 class
ImmutableTree.Builder
Builds instances of typeImmutableTree
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTree.Builder
builder()
Creates a builder forImmutableTree
.static ImmutableTree
copyOf(Tree instance)
Creates an immutable copy of aTree
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableTree
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,url
,tree
,truncated
.String
sha()
SHA.String
toString()
Prints the immutable valueTree
with attribute values.List<TreeItem>
tree()
Tree items.Boolean
truncated()
If true, the number of items in the tree array exceeded our maximum limit.URI
url()
URL.ImmutableTree
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableTree
withTree(TreeItem... elements)
Copy the current immutable object with elements that replace the content oftree
.ImmutableTree
withTree(Iterable<? extends TreeItem> elements)
Copy the current immutable object with elements that replace the content oftree
.ImmutableTree
withTruncated(Boolean value)
Copy the current immutable object by setting a value for thetruncated
attribute.ImmutableTree
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
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 thesha
attribute. 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
this
object
-
withUrl
public final ImmutableTree withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
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
this
object
-
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
this
object
-
withTruncated
public final ImmutableTree withTruncated(@Nullable Boolean value)
Copy the current immutable object by setting a value for thetruncated
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableTree
that 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 valueTree
with attribute values.
-
copyOf
public static ImmutableTree copyOf(Tree instance)
Creates an immutable copy of aTree
value. 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) // nullable
sha
.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
-
-