Package com.spotify.github.v3.git
Class ImmutableTreeItem
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableTreeItem
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTreeItem extends Object implements TreeItem
Immutable implementation ofTreeItem
.Use the builder to create immutable instances:
ImmutableTreeItem.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableTreeItem.Builder
Builds instances of typeImmutableTreeItem
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTreeItem.Builder
builder()
Creates a builder forImmutableTreeItem
.static ImmutableTreeItem
copyOf(TreeItem instance)
Creates an immutable copy of aTreeItem
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableTreeItem
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,url
,path
,mode
,type
,size
.String
mode()
The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree), 160000 for submodule (commit), or 120000 for a blob that specifies the path of a symlink.String
path()
The file referenced in the tree.String
sha()
SHA.Long
size()
File size in bytes.String
toString()
Prints the immutable valueTreeItem
with attribute values.String
type()
Either blob, tree, or commit.URI
url()
URL.ImmutableTreeItem
withMode(String value)
Copy the current immutable object by setting a value for themode
attribute.ImmutableTreeItem
withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute.ImmutableTreeItem
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableTreeItem
withSize(Long value)
Copy the current immutable object by setting a value for thesize
attribute.ImmutableTreeItem
withType(String value)
Copy the current immutable object by setting a value for thetype
attribute.ImmutableTreeItem
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
path
@Nullable public String path()
The file referenced in the tree.
-
mode
@Nullable public String mode()
The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree), 160000 for submodule (commit), or 120000 for a blob that specifies the path of a symlink.
-
type
@Nullable public String type()
Either blob, tree, or commit.
-
withSha
public final ImmutableTreeItem 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 ImmutableTreeItem 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
-
withPath
public final ImmutableTreeItem withPath(@Nullable String value)
Copy the current immutable object by setting a value for thepath
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for path (can benull
)- Returns:
- A modified copy of the
this
object
-
withMode
public final ImmutableTreeItem withMode(@Nullable String value)
Copy the current immutable object by setting a value for themode
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mode (can benull
)- Returns:
- A modified copy of the
this
object
-
withType
public final ImmutableTreeItem withType(@Nullable String value)
Copy the current immutable object by setting a value for thetype
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for type (can benull
)- Returns:
- A modified copy of the
this
object
-
withSize
public final ImmutableTreeItem withSize(@Nullable Long value)
Copy the current immutable object by setting a value for thesize
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for size (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableTreeItem
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha
,url
,path
,mode
,type
,size
.
-
toString
public String toString()
Prints the immutable valueTreeItem
with attribute values.
-
copyOf
public static ImmutableTreeItem copyOf(TreeItem instance)
Creates an immutable copy of aTreeItem
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 TreeItem instance
-
builder
public static ImmutableTreeItem.Builder builder()
Creates a builder forImmutableTreeItem
.ImmutableTreeItem.builder() .sha(String | null) // nullable
sha
.url(java.net.URI | null) // nullableurl
.path(String | null) // nullablepath
.mode(String | null) // nullablemode
.type(String | null) // nullabletype
.size(Long | null) // nullablesize
.build();- Returns:
- A new ImmutableTreeItem builder
-
-