Package com.spotify.github.v3.repos
Class ImmutableContent.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableContent.Builder
-
- Enclosing class:
- ImmutableContent
@NotThreadSafe public static final class ImmutableContent.Builder extends Object
Builds instances of typeImmutableContent
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableContent
build()
Builds a newImmutableContent
.ImmutableContent.Builder
content(String content)
Initializes the value for thecontent
attribute.ImmutableContent.Builder
downloadUrl(URI downloadUrl)
Initializes the value for thedownloadUrl
attribute.ImmutableContent.Builder
encoding(String encoding)
Initializes the value for theencoding
attribute.ImmutableContent.Builder
from(ShaLink instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLink
instance.ImmutableContent.Builder
from(Content instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Content
instance.ImmutableContent.Builder
from(FolderContent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.FolderContent
instance.ImmutableContent.Builder
gitUrl(URI gitUrl)
Initializes the value for thegitUrl
attribute.ImmutableContent.Builder
htmlUrl(URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.ImmutableContent.Builder
name(String name)
Initializes the value for thename
attribute.ImmutableContent.Builder
path(String path)
Initializes the value for thepath
attribute.ImmutableContent.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableContent.Builder
size(Integer size)
Initializes the value for thesize
attribute.ImmutableContent.Builder
type(String type)
Initializes the value for thetype
attribute.ImmutableContent.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableContent.Builder from(FolderContent instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.FolderContent
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableContent.Builder from(ShaLink instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.git.ShaLink
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableContent.Builder from(Content instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Content
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableContent.Builder sha(@Nullable String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha (can benull
)- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableContent.Builder url(@Nullable URI url)
Initializes the value for theurl
attribute.- Parameters:
url
- The value for url (can benull
)- Returns:
this
builder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableContent.Builder type(@Nullable String type)
Initializes the value for thetype
attribute.- Parameters:
type
- The value for type (can benull
)- Returns:
this
builder for use in a chained invocation
-
size
@CanIgnoreReturnValue public final ImmutableContent.Builder size(@Nullable Integer size)
Initializes the value for thesize
attribute.- Parameters:
size
- The value for size (can benull
)- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableContent.Builder name(@Nullable String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name (can benull
)- Returns:
this
builder for use in a chained invocation
-
path
@CanIgnoreReturnValue public final ImmutableContent.Builder path(@Nullable String path)
Initializes the value for thepath
attribute.- Parameters:
path
- The value for path (can benull
)- Returns:
this
builder for use in a chained invocation
-
gitUrl
@CanIgnoreReturnValue public final ImmutableContent.Builder gitUrl(@Nullable URI gitUrl)
Initializes the value for thegitUrl
attribute.- Parameters:
gitUrl
- The value for gitUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableContent.Builder htmlUrl(@Nullable URI htmlUrl)
Initializes the value for thehtmlUrl
attribute.- Parameters:
htmlUrl
- The value for htmlUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
downloadUrl
@CanIgnoreReturnValue public final ImmutableContent.Builder downloadUrl(@Nullable URI downloadUrl)
Initializes the value for thedownloadUrl
attribute.- Parameters:
downloadUrl
- The value for downloadUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
encoding
@CanIgnoreReturnValue public final ImmutableContent.Builder encoding(@Nullable String encoding)
Initializes the value for theencoding
attribute.- Parameters:
encoding
- The value for encoding (can benull
)- Returns:
this
builder for use in a chained invocation
-
content
@CanIgnoreReturnValue public final ImmutableContent.Builder content(@Nullable String content)
Initializes the value for thecontent
attribute.- Parameters:
content
- The value for content (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableContent build()
Builds a newImmutableContent
.- Returns:
- An immutable instance of Content
- Throws:
IllegalStateException
- if any required attributes are missing
-
-