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.Builderis 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 ImmutableDeploymentbuild()Builds a newImmutableDeployment.ImmutableDeployment.BuildercreatedAt(GitHubInstant createdAt)Initializes the value for thecreatedAtattribute.ImmutableDeployment.Buildercreator(User creator)Initializes the value for thecreatorattribute.ImmutableDeployment.Builderdescription(String description)Initializes the optional valuedescriptionto description.ImmutableDeployment.Builderdescription(Optional<String> description)Initializes the optional valuedescriptionto description.ImmutableDeployment.Builderenvironment(String environment)Initializes the value for theenvironmentattribute.ImmutableDeployment.Builderfrom(UpdateTracking instance)Fill a builder with attribute values from the providedcom.spotify.github.UpdateTrackinginstance.ImmutableDeployment.Builderfrom(Deployment instance)Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Deploymentinstance.ImmutableDeployment.Builderid(Long id)Initializes the value for theidattribute.ImmutableDeployment.Builderpayload(Map<String,String> payload)Initializes the optional valuepayloadto payload.ImmutableDeployment.Builderpayload(Optional<? extends Map<String,String>> payload)Initializes the optional valuepayloadto payload.ImmutableDeployment.Builderref(String ref)Initializes the value for therefattribute.ImmutableDeployment.BuilderrepositoryUrl(URI repositoryUrl)Initializes the value for therepositoryUrlattribute.ImmutableDeployment.Buildersha(String sha)Initializes the value for theshaattribute.ImmutableDeployment.BuilderstatusesUrl(URI statusesUrl)Initializes the value for thestatusesUrlattribute.ImmutableDeployment.Buildertask(String task)Initializes the value for thetaskattribute.ImmutableDeployment.BuilderupdatedAt(GitHubInstant updatedAt)Initializes the value for theupdatedAtattribute.ImmutableDeployment.Builderurl(URI url)Initializes the value for theurlattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableDeployment.Builder from(Deployment instance)
Fill a builder with attribute values from the providedcom.spotify.github.v3.repos.Deploymentinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder 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.UpdateTrackinginstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableDeployment.Builder createdAt(@Nullable GitHubInstant createdAt)
Initializes the value for thecreatedAtattribute.- Parameters:
createdAt- The value for createdAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableDeployment.Builder updatedAt(@Nullable GitHubInstant updatedAt)
Initializes the value for theupdatedAtattribute.- Parameters:
updatedAt- The value for updatedAt (can benull)- Returns:
thisbuilder for use in a chained invocation
-
url
@CanIgnoreReturnValue public final ImmutableDeployment.Builder url(@Nullable URI url)
Initializes the value for theurlattribute.- Parameters:
url- The value for url (can benull)- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableDeployment.Builder id(@Nullable Long id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableDeployment.Builder sha(@Nullable String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha (can benull)- Returns:
thisbuilder for use in a chained invocation
-
ref
@CanIgnoreReturnValue public final ImmutableDeployment.Builder ref(@Nullable String ref)
Initializes the value for therefattribute.- Parameters:
ref- The value for ref (can benull)- Returns:
thisbuilder for use in a chained invocation
-
task
@CanIgnoreReturnValue public final ImmutableDeployment.Builder task(@Nullable String task)
Initializes the value for thetaskattribute.- Parameters:
task- The value for task (can benull)- Returns:
thisbuilder for use in a chained invocation
-
payload
@CanIgnoreReturnValue public final ImmutableDeployment.Builder payload(Map<String,String> payload)
Initializes the optional valuepayloadto payload.- Parameters:
payload- The value for payload- Returns:
thisbuilder for chained invocation
-
payload
@CanIgnoreReturnValue public final ImmutableDeployment.Builder payload(Optional<? extends Map<String,String>> payload)
Initializes the optional valuepayloadto payload.- Parameters:
payload- The value for payload- Returns:
thisbuilder for use in a chained invocation
-
environment
@CanIgnoreReturnValue public final ImmutableDeployment.Builder environment(@Nullable String environment)
Initializes the value for theenvironmentattribute.- Parameters:
environment- The value for environment (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableDeployment.Builder description(String description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableDeployment.Builder description(Optional<String> description)
Initializes the optional valuedescriptionto description.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
creator
@CanIgnoreReturnValue public final ImmutableDeployment.Builder creator(@Nullable User creator)
Initializes the value for thecreatorattribute.- Parameters:
creator- The value for creator (can benull)- Returns:
thisbuilder for use in a chained invocation
-
statusesUrl
@CanIgnoreReturnValue public final ImmutableDeployment.Builder statusesUrl(@Nullable URI statusesUrl)
Initializes the value for thestatusesUrlattribute.- Parameters:
statusesUrl- The value for statusesUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
repositoryUrl
@CanIgnoreReturnValue public final ImmutableDeployment.Builder repositoryUrl(@Nullable URI repositoryUrl)
Initializes the value for therepositoryUrlattribute.- Parameters:
repositoryUrl- The value for repositoryUrl (can benull)- Returns:
thisbuilder 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
-
-