Package com.spotify.github.v3.git
Class ImmutableBlob
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableBlob
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBlob extends Object implements Blob
Immutable implementation ofBlob
.Use the builder to create immutable instances:
ImmutableBlob.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableBlob.Builder
Builds instances of typeImmutableBlob
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableBlob.Builder
builder()
Creates a builder forImmutableBlob
.String
content()
Encoded blob content.static ImmutableBlob
copyOf(Blob instance)
Creates an immutable copy of aBlob
value.String
encoding()
Encoding name.boolean
equals(Object another)
This instance is equal to all instances ofImmutableBlob
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sha
,url
,content
,encoding
,size
.String
sha()
SHA.Integer
size()
Content size in bytes.String
toString()
Prints the immutable valueBlob
with attribute values.URI
url()
URL.ImmutableBlob
withContent(String value)
Copy the current immutable object by setting a value for thecontent
attribute.ImmutableBlob
withEncoding(String value)
Copy the current immutable object by setting a value for theencoding
attribute.ImmutableBlob
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableBlob
withSize(Integer value)
Copy the current immutable object by setting a value for thesize
attribute.ImmutableBlob
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
content
@Nullable public String content()
Encoded blob content.
-
encoding
@Nullable public String encoding()
Encoding name. Currently, "utf-8" and "base64" are supported. Default: "utf-8".
-
withSha
public final ImmutableBlob 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 ImmutableBlob 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
-
withContent
public final ImmutableBlob withContent(@Nullable String value)
Copy the current immutable object by setting a value for thecontent
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for content (can benull
)- Returns:
- A modified copy of the
this
object
-
withEncoding
public final ImmutableBlob withEncoding(@Nullable String value)
Copy the current immutable object by setting a value for theencoding
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for encoding (can benull
)- Returns:
- A modified copy of the
this
object
-
withSize
public final ImmutableBlob withSize(@Nullable Integer 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 ofImmutableBlob
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha
,url
,content
,encoding
,size
.
-
toString
public String toString()
Prints the immutable valueBlob
with attribute values.
-
copyOf
public static ImmutableBlob copyOf(Blob instance)
Creates an immutable copy of aBlob
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 Blob instance
-
builder
public static ImmutableBlob.Builder builder()
Creates a builder forImmutableBlob
.ImmutableBlob.builder() .sha(String | null) // nullable
sha
.url(java.net.URI | null) // nullableurl
.content(String | null) // nullablecontent
.encoding(String | null) // nullableencoding
.size(Integer | null) // nullablesize
.build();- Returns:
- A new ImmutableBlob builder
-
-