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 classImmutableBlob.BuilderBuilds instances of typeImmutableBlob.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableBlob.Builderbuilder()Creates a builder forImmutableBlob.Stringcontent()Encoded blob content.static ImmutableBlobcopyOf(Blob instance)Creates an immutable copy of aBlobvalue.Stringencoding()Encoding name.booleanequals(Object another)This instance is equal to all instances ofImmutableBlobthat have equal attribute values.inthashCode()Computes a hash code from attributes:sha,url,content,encoding,size.Stringsha()SHA.Integersize()Content size in bytes.StringtoString()Prints the immutable valueBlobwith attribute values.URIurl()URL.ImmutableBlobwithContent(String value)Copy the current immutable object by setting a value for thecontentattribute.ImmutableBlobwithEncoding(String value)Copy the current immutable object by setting a value for theencodingattribute.ImmutableBlobwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableBlobwithSize(Integer value)Copy the current immutable object by setting a value for thesizeattribute.ImmutableBlobwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
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 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 ImmutableBlob 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
-
withContent
public final ImmutableBlob withContent(@Nullable String value)
Copy the current immutable object by setting a value for thecontentattribute. 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
thisobject
-
withEncoding
public final ImmutableBlob withEncoding(@Nullable String value)
Copy the current immutable object by setting a value for theencodingattribute. 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
thisobject
-
withSize
public final ImmutableBlob withSize(@Nullable Integer value)
Copy the current immutable object by setting a value for thesizeattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableBlobthat 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 valueBlobwith attribute values.
-
copyOf
public static ImmutableBlob copyOf(Blob instance)
Creates an immutable copy of aBlobvalue. 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) // nullablesha.url(java.net.URI | null) // nullableurl.content(String | null) // nullablecontent.encoding(String | null) // nullableencoding.size(Integer | null) // nullablesize.build();- Returns:
- A new ImmutableBlob builder
-
-