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 classImmutableContent.BuilderBuilds instances of typeImmutableContent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableContent.Builderbuilder()Creates a builder forImmutableContent.Stringcontent()Actual encoded contentstatic ImmutableContentcopyOf(Content instance)Creates an immutable copy of aContentvalue.URIdownloadUrl()Content download URLStringencoding()Encoding name.booleanequals(Object another)This instance is equal to all instances ofImmutableContentthat have equal attribute values.URIgitUrl()Git blob API URLinthashCode()Computes a hash code from attributes:sha,url,type,size,name,path,gitUrl,htmlUrl,downloadUrl,encoding,content.URIhtmlUrl()Content URLStringname()Content name.Stringpath()The content path.Stringsha()SHA.Integersize()Content size in bytesStringtoString()Prints the immutable valueContentwith attribute values.Stringtype()Content type.URIurl()URL.ImmutableContentwithContent(String value)Copy the current immutable object by setting a value for thecontentattribute.ImmutableContentwithDownloadUrl(URI value)Copy the current immutable object by setting a value for thedownloadUrlattribute.ImmutableContentwithEncoding(String value)Copy the current immutable object by setting a value for theencodingattribute.ImmutableContentwithGitUrl(URI value)Copy the current immutable object by setting a value for thegitUrlattribute.ImmutableContentwithHtmlUrl(URI value)Copy the current immutable object by setting a value for thehtmlUrlattribute.ImmutableContentwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableContentwithPath(String value)Copy the current immutable object by setting a value for thepathattribute.ImmutableContentwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableContentwithSize(Integer value)Copy the current immutable object by setting a value for thesizeattribute.ImmutableContentwithType(String value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableContentwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
type
@Nullable public String type()
Content type. E.g file, dir, symlink, submodule- Specified by:
typein interfaceFolderContent
-
size
@Nullable public Integer size()
Content size in bytes- Specified by:
sizein interfaceFolderContent
-
name
@Nullable public String name()
Content name. E.g. file name- Specified by:
namein interfaceFolderContent
-
path
@Nullable public String path()
The content path.- Specified by:
pathin interfaceFolderContent
-
gitUrl
@Nullable public URI gitUrl()
Git blob API URL- Specified by:
gitUrlin interfaceFolderContent
-
htmlUrl
@Nullable public URI htmlUrl()
Content URL- Specified by:
htmlUrlin interfaceFolderContent
-
downloadUrl
@Nullable public URI downloadUrl()
Content download URL- Specified by:
downloadUrlin 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 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 ImmutableContent 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
-
withType
public final ImmutableContent withType(@Nullable String value)
Copy the current immutable object by setting a value for thetypeattribute. 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
thisobject
-
withSize
public final ImmutableContent 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
-
withName
public final ImmutableContent withName(@Nullable String value)
Copy the current immutable object by setting a value for thenameattribute. 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
thisobject
-
withPath
public final ImmutableContent withPath(@Nullable String value)
Copy the current immutable object by setting a value for thepathattribute. 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
thisobject
-
withGitUrl
public final ImmutableContent withGitUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thegitUrlattribute. 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
thisobject
-
withHtmlUrl
public final ImmutableContent withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrlattribute. 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
thisobject
-
withDownloadUrl
public final ImmutableContent withDownloadUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thedownloadUrlattribute. 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
thisobject
-
withEncoding
public final ImmutableContent 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
-
withContent
public final ImmutableContent 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
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableContentthat 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 valueContentwith attribute values.
-
copyOf
public static ImmutableContent copyOf(Content instance)
Creates an immutable copy of aContentvalue. 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) // nullablesha.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
-
-