Package com.spotify.github.v3.checks
Class ImmutableInstallation.Builder
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableInstallation.Builder
-
- Enclosing class:
- ImmutableInstallation
@NotThreadSafe public static final class ImmutableInstallation.Builder extends Object
Builds instances of typeImmutableInstallation
. 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 ImmutableInstallation.Builder
accessTokensUrl(String accessTokensUrl)
Initializes the value for theaccessTokensUrl
attribute.ImmutableInstallation.Builder
account(User account)
Initializes the value for theaccount
attribute.ImmutableInstallation.Builder
addAllEvents(Iterable<String> elements)
Adds elements toevents
list.ImmutableInstallation.Builder
addEvents(String element)
Adds one element toevents
list.ImmutableInstallation.Builder
addEvents(String... elements)
Adds elements toevents
list.ImmutableInstallation.Builder
appId(int appId)
Initializes the value for theappId
attribute.ImmutableInstallation
build()
Builds a newImmutableInstallation
.ImmutableInstallation.Builder
events(Iterable<String> elements)
Sets or replaces all elements forevents
list.ImmutableInstallation.Builder
from(Installation instance)
Fill a builder with attribute values from the providedInstallation
instance.ImmutableInstallation.Builder
htmlUrl(String htmlUrl)
Initializes the optional valuehtmlUrl
to htmlUrl.ImmutableInstallation.Builder
htmlUrl(Optional<String> htmlUrl)
Initializes the optional valuehtmlUrl
to htmlUrl.ImmutableInstallation.Builder
id(int id)
Initializes the value for theid
attribute.ImmutableInstallation.Builder
permissions(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for thepermissions
map.ImmutableInstallation.Builder
putAllPermissions(Map<String,? extends String> entries)
Put all mappings from the specified map as entries topermissions
map.ImmutableInstallation.Builder
putPermissions(String key, String value)
Put one entry to thepermissions
map.ImmutableInstallation.Builder
putPermissions(Map.Entry<String,? extends String> entry)
Put one entry to thepermissions
map.ImmutableInstallation.Builder
repositoriesUrl(String repositoriesUrl)
Initializes the value for therepositoriesUrl
attribute.ImmutableInstallation.Builder
repositorySelection(String repositorySelection)
Initializes the optional valuerepositorySelection
to repositorySelection.ImmutableInstallation.Builder
repositorySelection(Optional<String> repositorySelection)
Initializes the optional valuerepositorySelection
to repositorySelection.ImmutableInstallation.Builder
singleFileName(String singleFileName)
Initializes the optional valuesingleFileName
to singleFileName.ImmutableInstallation.Builder
singleFileName(Optional<String> singleFileName)
Initializes the optional valuesingleFileName
to singleFileName.ImmutableInstallation.Builder
targetId(int targetId)
Initializes the value for thetargetId
attribute.ImmutableInstallation.Builder
targetType(String targetType)
Initializes the value for thetargetType
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableInstallation.Builder from(Installation instance)
Fill a builder with attribute values from the providedInstallation
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableInstallation.Builder id(int id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
account
@CanIgnoreReturnValue public final ImmutableInstallation.Builder account(User account)
Initializes the value for theaccount
attribute.- Parameters:
account
- The value for account- Returns:
this
builder for use in a chained invocation
-
accessTokensUrl
@CanIgnoreReturnValue public final ImmutableInstallation.Builder accessTokensUrl(String accessTokensUrl)
Initializes the value for theaccessTokensUrl
attribute.- Parameters:
accessTokensUrl
- The value for accessTokensUrl- Returns:
this
builder for use in a chained invocation
-
repositoriesUrl
@CanIgnoreReturnValue public final ImmutableInstallation.Builder repositoriesUrl(String repositoriesUrl)
Initializes the value for therepositoriesUrl
attribute.- Parameters:
repositoriesUrl
- The value for repositoriesUrl- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableInstallation.Builder htmlUrl(String htmlUrl)
Initializes the optional valuehtmlUrl
to htmlUrl.- Parameters:
htmlUrl
- The value for htmlUrl- Returns:
this
builder for chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableInstallation.Builder htmlUrl(Optional<String> htmlUrl)
Initializes the optional valuehtmlUrl
to htmlUrl.- Parameters:
htmlUrl
- The value for htmlUrl- Returns:
this
builder for use in a chained invocation
-
appId
@CanIgnoreReturnValue public final ImmutableInstallation.Builder appId(int appId)
Initializes the value for theappId
attribute.- Parameters:
appId
- The value for appId- Returns:
this
builder for use in a chained invocation
-
targetId
@CanIgnoreReturnValue public final ImmutableInstallation.Builder targetId(int targetId)
Initializes the value for thetargetId
attribute.- Parameters:
targetId
- The value for targetId- Returns:
this
builder for use in a chained invocation
-
targetType
@CanIgnoreReturnValue public final ImmutableInstallation.Builder targetType(String targetType)
Initializes the value for thetargetType
attribute.- Parameters:
targetType
- The value for targetType- Returns:
this
builder for use in a chained invocation
-
putPermissions
@CanIgnoreReturnValue public final ImmutableInstallation.Builder putPermissions(String key, String value)
Put one entry to thepermissions
map.- Parameters:
key
- The key in the permissions mapvalue
- The associated value in the permissions map- Returns:
this
builder for use in a chained invocation
-
putPermissions
@CanIgnoreReturnValue public final ImmutableInstallation.Builder putPermissions(Map.Entry<String,? extends String> entry)
Put one entry to thepermissions
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
permissions
@CanIgnoreReturnValue public final ImmutableInstallation.Builder permissions(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for thepermissions
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the permissions map- Returns:
this
builder for use in a chained invocation
-
putAllPermissions
@CanIgnoreReturnValue public final ImmutableInstallation.Builder putAllPermissions(Map<String,? extends String> entries)
Put all mappings from the specified map as entries topermissions
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the permissions map- Returns:
this
builder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableInstallation.Builder addEvents(String element)
Adds one element toevents
list.- Parameters:
element
- A events element- Returns:
this
builder for use in a chained invocation
-
addEvents
@CanIgnoreReturnValue public final ImmutableInstallation.Builder addEvents(String... elements)
Adds elements toevents
list.- Parameters:
elements
- An array of events elements- Returns:
this
builder for use in a chained invocation
-
events
@CanIgnoreReturnValue public final ImmutableInstallation.Builder events(Iterable<String> elements)
Sets or replaces all elements forevents
list.- Parameters:
elements
- An iterable of events elements- Returns:
this
builder for use in a chained invocation
-
addAllEvents
@CanIgnoreReturnValue public final ImmutableInstallation.Builder addAllEvents(Iterable<String> elements)
Adds elements toevents
list.- Parameters:
elements
- An iterable of events elements- Returns:
this
builder for use in a chained invocation
-
singleFileName
@CanIgnoreReturnValue public final ImmutableInstallation.Builder singleFileName(String singleFileName)
Initializes the optional valuesingleFileName
to singleFileName.- Parameters:
singleFileName
- The value for singleFileName- Returns:
this
builder for chained invocation
-
singleFileName
@CanIgnoreReturnValue public final ImmutableInstallation.Builder singleFileName(Optional<String> singleFileName)
Initializes the optional valuesingleFileName
to singleFileName.- Parameters:
singleFileName
- The value for singleFileName- Returns:
this
builder for use in a chained invocation
-
repositorySelection
@CanIgnoreReturnValue public final ImmutableInstallation.Builder repositorySelection(String repositorySelection)
Initializes the optional valuerepositorySelection
to repositorySelection.- Parameters:
repositorySelection
- The value for repositorySelection- Returns:
this
builder for chained invocation
-
repositorySelection
@CanIgnoreReturnValue public final ImmutableInstallation.Builder repositorySelection(Optional<String> repositorySelection)
Initializes the optional valuerepositorySelection
to repositorySelection.- Parameters:
repositorySelection
- The value for repositorySelection- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableInstallation build()
Builds a newImmutableInstallation
.- Returns:
- An immutable instance of Installation
- Throws:
IllegalStateException
- if any required attributes are missing
-
-