Package com.spotify.github.v3.repos
Class ImmutableContent
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableContent
-
- All Implemented Interfaces:
ShaLink
,Content
,FolderContent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableContent extends Object implements Content
Immutable implementation ofContent
.Use the builder to create immutable instances:
ImmutableContent.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableContent.Builder
Builds instances of typeImmutableContent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableContent.Builder
builder()
Creates a builder forImmutableContent
.String
content()
Actual encoded contentstatic ImmutableContent
copyOf(Content instance)
Creates an immutable copy of aContent
value.URI
downloadUrl()
Content download URLString
encoding()
Encoding name.boolean
equals(Object another)
This instance is equal to all instances ofImmutableContent
that have equal attribute values.URI
gitUrl()
Git blob API URLint
hashCode()
Computes a hash code from attributes:sha
,url
,type
,size
,name
,path
,gitUrl
,htmlUrl
,downloadUrl
,encoding
,content
.URI
htmlUrl()
Content URLString
name()
Content name.String
path()
The content path.String
sha()
SHA.Integer
size()
Content size in bytesString
toString()
Prints the immutable valueContent
with attribute values.String
type()
Content type.URI
url()
URL.ImmutableContent
withContent(String value)
Copy the current immutable object by setting a value for thecontent
attribute.ImmutableContent
withDownloadUrl(URI value)
Copy the current immutable object by setting a value for thedownloadUrl
attribute.ImmutableContent
withEncoding(String value)
Copy the current immutable object by setting a value for theencoding
attribute.ImmutableContent
withGitUrl(URI value)
Copy the current immutable object by setting a value for thegitUrl
attribute.ImmutableContent
withHtmlUrl(URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableContent
withName(String value)
Copy the current immutable object by setting a value for thename
attribute.ImmutableContent
withPath(String value)
Copy the current immutable object by setting a value for thepath
attribute.ImmutableContent
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.ImmutableContent
withSize(Integer value)
Copy the current immutable object by setting a value for thesize
attribute.ImmutableContent
withType(String value)
Copy the current immutable object by setting a value for thetype
attribute.ImmutableContent
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
type
@Nullable public String type()
Content type. E.g file, dir, symlink, submodule- Specified by:
type
in interfaceFolderContent
-
size
@Nullable public Integer size()
Content size in bytes- Specified by:
size
in interfaceFolderContent
-
name
@Nullable public String name()
Content name. E.g. file name- Specified by:
name
in interfaceFolderContent
-
path
@Nullable public String path()
The content path.- Specified by:
path
in interfaceFolderContent
-
gitUrl
@Nullable public URI gitUrl()
Git blob API URL- Specified by:
gitUrl
in interfaceFolderContent
-
htmlUrl
@Nullable public URI htmlUrl()
Content URL- Specified by:
htmlUrl
in interfaceFolderContent
-
downloadUrl
@Nullable public URI downloadUrl()
Content download URL- Specified by:
downloadUrl
in interfaceFolderContent
-
encoding
@Nullable public String encoding()
Encoding name. E.g. base64
-
content
@Nullable public String content()
Actual encoded content
-
withSha
public final ImmutableContent 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 ImmutableContent 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
-
withType
public final ImmutableContent 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 ImmutableContent 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
-
withName
public final ImmutableContent withName(@Nullable String value)
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name (can benull
)- Returns:
- A modified copy of the
this
object
-
withPath
public final ImmutableContent 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
-
withGitUrl
public final ImmutableContent withGitUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thegitUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for gitUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withHtmlUrl
public final ImmutableContent withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for htmlUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withDownloadUrl
public final ImmutableContent withDownloadUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thedownloadUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for downloadUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withEncoding
public final ImmutableContent 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
-
withContent
public final ImmutableContent 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
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableContent
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha
,url
,type
,size
,name
,path
,gitUrl
,htmlUrl
,downloadUrl
,encoding
,content
.
-
toString
public String toString()
Prints the immutable valueContent
with attribute values.
-
copyOf
public static ImmutableContent copyOf(Content instance)
Creates an immutable copy of aContent
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 Content instance
-
builder
public static ImmutableContent.Builder builder()
Creates a builder forImmutableContent
.ImmutableContent.builder() .sha(String | null) // nullable
sha
.url(java.net.URI | null) // nullableurl
.type(String | null) // nullabletype
.size(Integer | null) // nullablesize
.name(String | null) // nullablename
.path(String | null) // nullablepath
.gitUrl(java.net.URI | null) // nullablegitUrl
.htmlUrl(java.net.URI | null) // nullablehtmlUrl
.downloadUrl(java.net.URI | null) // nullabledownloadUrl
.encoding(String | null) // nullableencoding
.content(String | null) // nullablecontent
.build();- Returns:
- A new ImmutableContent builder
-
-