Package com.spotify.github.v3.checks
Class ImmutableApp.Builder
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableApp.Builder
-
- Enclosing class:
- ImmutableApp
@NotThreadSafe public static final class ImmutableApp.Builder extends Object
Builds instances of typeImmutableApp
. 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 ImmutableApp.Builder
addAllEvents(Iterable<String> elements)
Adds elements toevents
list.ImmutableApp.Builder
addEvents(String element)
Adds one element toevents
list.ImmutableApp.Builder
addEvents(String... elements)
Adds elements toevents
list.ImmutableApp
build()
Builds a newImmutableApp
.ImmutableApp.Builder
createdAt(ZonedDateTime createdAt)
Initializes the value for thecreatedAt
attribute.ImmutableApp.Builder
description(String description)
Initializes the value for thedescription
attribute.ImmutableApp.Builder
events(Iterable<String> elements)
Sets or replaces all elements forevents
list.ImmutableApp.Builder
externalUrl(String externalUrl)
Initializes the value for theexternalUrl
attribute.ImmutableApp.Builder
from(App instance)
Fill a builder with attribute values from the providedApp
instance.ImmutableApp.Builder
htmlUrl(String htmlUrl)
Initializes the value for thehtmlUrl
attribute.ImmutableApp.Builder
id(Integer id)
Initializes the value for theid
attribute.ImmutableApp.Builder
installationsCount(int installationsCount)
Initializes the optional valueinstallationsCount
to installationsCount.ImmutableApp.Builder
installationsCount(Optional<Integer> installationsCount)
Initializes the optional valueinstallationsCount
to installationsCount.ImmutableApp.Builder
name(String name)
Initializes the value for thename
attribute.ImmutableApp.Builder
permissions(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for thepermissions
map.ImmutableApp.Builder
putAllPermissions(Map<String,? extends String> entries)
Put all mappings from the specified map as entries topermissions
map.ImmutableApp.Builder
putPermissions(String key, String value)
Put one entry to thepermissions
map.ImmutableApp.Builder
putPermissions(Map.Entry<String,? extends String> entry)
Put one entry to thepermissions
map.ImmutableApp.Builder
slug(String slug)
Initializes the optional valueslug
to slug.ImmutableApp.Builder
slug(Optional<String> slug)
Initializes the optional valueslug
to slug.ImmutableApp.Builder
updatedAt(ZonedDateTime updatedAt)
Initializes the value for theupdatedAt
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableApp.Builder from(App instance)
Fill a builder with attribute values from the providedApp
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 ImmutableApp.Builder id(Integer id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
slug
@CanIgnoreReturnValue public final ImmutableApp.Builder slug(String slug)
Initializes the optional valueslug
to slug.- Parameters:
slug
- The value for slug- Returns:
this
builder for chained invocation
-
slug
@CanIgnoreReturnValue public final ImmutableApp.Builder slug(Optional<String> slug)
Initializes the optional valueslug
to slug.- Parameters:
slug
- The value for slug- Returns:
this
builder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableApp.Builder name(String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableApp.Builder description(String description)
Initializes the value for thedescription
attribute.- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
externalUrl
@CanIgnoreReturnValue public final ImmutableApp.Builder externalUrl(String externalUrl)
Initializes the value for theexternalUrl
attribute.- Parameters:
externalUrl
- The value for externalUrl- Returns:
this
builder for use in a chained invocation
-
htmlUrl
@CanIgnoreReturnValue public final ImmutableApp.Builder htmlUrl(String htmlUrl)
Initializes the value for thehtmlUrl
attribute.- Parameters:
htmlUrl
- The value for htmlUrl- Returns:
this
builder for use in a chained invocation
-
createdAt
@CanIgnoreReturnValue public final ImmutableApp.Builder createdAt(ZonedDateTime createdAt)
Initializes the value for thecreatedAt
attribute.- Parameters:
createdAt
- The value for createdAt- Returns:
this
builder for use in a chained invocation
-
updatedAt
@CanIgnoreReturnValue public final ImmutableApp.Builder updatedAt(ZonedDateTime updatedAt)
Initializes the value for theupdatedAt
attribute.- Parameters:
updatedAt
- The value for updatedAt- Returns:
this
builder for use in a chained invocation
-
putPermissions
@CanIgnoreReturnValue public final ImmutableApp.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 ImmutableApp.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 ImmutableApp.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 ImmutableApp.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 ImmutableApp.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 ImmutableApp.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 ImmutableApp.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 ImmutableApp.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
-
installationsCount
@CanIgnoreReturnValue public final ImmutableApp.Builder installationsCount(int installationsCount)
Initializes the optional valueinstallationsCount
to installationsCount.- Parameters:
installationsCount
- The value for installationsCount- Returns:
this
builder for chained invocation
-
installationsCount
@CanIgnoreReturnValue public final ImmutableApp.Builder installationsCount(Optional<Integer> installationsCount)
Initializes the optional valueinstallationsCount
to installationsCount.- Parameters:
installationsCount
- The value for installationsCount- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableApp build()
Builds a newImmutableApp
.- Returns:
- An immutable instance of App
- Throws:
IllegalStateException
- if any required attributes are missing
-
-