Package com.spotify.github.v3.repos
Class ImmutableDeployment.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableDeployment.Builder
-
- Enclosing class:
- ImmutableDeployment
@NotThreadSafe public static final class ImmutableDeployment.Builder extends Object
Builds instances of typeImmutableDeployment
. 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 ImmutableDeployment
build()
Builds a newImmutableDeployment
.ImmutableDeployment.Builder
createdAt(GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.ImmutableDeployment.Builder
creator(User creator)
Initializes the value for thecreator
attribute.ImmutableDeployment.Builder
description(String description)
Initializes the optional valuedescription
to description.ImmutableDeployment.Builder
description(Optional<String> description)
Initializes the optional valuedescription
to description.ImmutableDeployment.Builder
environment(String environment)
Initializes the value for theenvironment
attribute.ImmutableDeployment.Builder
from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTracking
instance.ImmutableDeployment.Builder
from(Deployment instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Deployment
instance.ImmutableDeployment.Builder
id(Long id)
Initializes the value for theid
attribute.ImmutableDeployment.Builder
payload(Map<String,String> payload)
Initializes the optional valuepayload
to payload.ImmutableDeployment.Builder
payload(Optional<? extends Map<String,String>> payload)
Initializes the optional valuepayload
to payload.ImmutableDeployment.Builder
ref(String ref)
Initializes the value for theref
attribute.ImmutableDeployment.Builder
repositoryUrl(URI repositoryUrl)
Initializes the value for therepositoryUrl
attribute.ImmutableDeployment.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableDeployment.Builder
statusesUrl(URI statusesUrl)
Initializes the value for thestatusesUrl
attribute.ImmutableDeployment.Builder
task(String task)
Initializes the value for thetask
attribute.ImmutableDeployment.Builder
updatedAt(GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.ImmutableDeployment.Builder
url(URI url)
Initializes the value for theurl
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableDeployment.Builder from(Deployment instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Deployment
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableDeployment.Builder from(UpdateTracking instance)
Fill a builder with attribute values from the providedcom.spotify.github.UpdateTracking
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableDeployment.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAt
attribute.- Parameters:
createdAt
- The value for createdAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableDeployment.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAt
attribute.- Parameters:
updatedAt
- The value for updatedAt (can benull
)- Returns:
this
builder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableDeployment.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
-
id
@CanIgnoreReturnValue public final ImmutableDeployment.Builder id(@Nullable Long id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableDeployment.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
-
ref
@CanIgnoreReturnValue public final ImmutableDeployment.Builder ref(@Nullable String ref)
Initializes the value for theref
attribute.- Parameters:
ref
- The value for ref (can benull
)- Returns:
this
builder for use in a chained invocation
-
task
@CanIgnoreReturnValue public final ImmutableDeployment.Builder task(@Nullable String task)
Initializes the value for thetask
attribute.- Parameters:
task
- The value for task (can benull
)- Returns:
this
builder for use in a chained invocation
-
payload
@CanIgnoreReturnValue public final ImmutableDeployment.Builder payload(Map<String,String> payload)
Initializes the optional valuepayload
to payload.- Parameters:
payload
- The value for payload- Returns:
this
builder for chained invocation
-
payload
@CanIgnoreReturnValue public final ImmutableDeployment.Builder payload(Optional<? extends Map<String,String>> payload)
Initializes the optional valuepayload
to payload.- Parameters:
payload
- The value for payload- Returns:
this
builder for use in a chained invocation
-
environment
@CanIgnoreReturnValue public final ImmutableDeployment.Builder environment(@Nullable String environment)
Initializes the value for theenvironment
attribute.- Parameters:
environment
- The value for environment (can benull
)- Returns:
this
builder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableDeployment.Builder description(String description)
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableDeployment.Builder description(Optional<String> description)
Initializes the optional valuedescription
to description.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
creator
@CanIgnoreReturnValue public final ImmutableDeployment.Builder creator(@Nullable User creator)
Initializes the value for thecreator
attribute.- Parameters:
creator
- The value for creator (can benull
)- Returns:
this
builder for use in a chained invocation
-
statusesUrl
@CanIgnoreReturnValue public final ImmutableDeployment.Builder statusesUrl(@Nullable URI statusesUrl)
Initializes the value for thestatusesUrl
attribute.- Parameters:
statusesUrl
- The value for statusesUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
repositoryUrl
@CanIgnoreReturnValue public final ImmutableDeployment.Builder repositoryUrl(@Nullable URI repositoryUrl)
Initializes the value for therepositoryUrl
attribute.- Parameters:
repositoryUrl
- The value for repositoryUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableDeployment build()
Builds a newImmutableDeployment
.- Returns:
- An immutable instance of Deployment
- Throws:
IllegalStateException
- if any required attributes are missing
-
-