Package com.spotify.github.v3.repos
Class ImmutablePermissions.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutablePermissions.Builder
-
- Enclosing class:
- ImmutablePermissions
@NotThreadSafe public static final class ImmutablePermissions.Builder extends Object
Builds instances of typeImmutablePermissions
. 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 ImmutablePermissions.Builder
admin(Boolean admin)
Initializes the value for theadmin
attribute.ImmutablePermissions
build()
Builds a newImmutablePermissions
.ImmutablePermissions.Builder
from(Permissions instance)
Fill a builder with attribute values from the providedPermissions
instance.ImmutablePermissions.Builder
pull(Boolean pull)
Initializes the value for thepull
attribute.ImmutablePermissions.Builder
push(Boolean push)
Initializes the value for thepush
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePermissions.Builder from(Permissions instance)
Fill a builder with attribute values from the providedPermissions
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
admin
@CanIgnoreReturnValue public final ImmutablePermissions.Builder admin(@Nullable Boolean admin)
Initializes the value for theadmin
attribute.- Parameters:
admin
- The value for admin (can benull
)- Returns:
this
builder for use in a chained invocation
-
push
@CanIgnoreReturnValue public final ImmutablePermissions.Builder push(@Nullable Boolean push)
Initializes the value for thepush
attribute.- Parameters:
push
- The value for push (can benull
)- Returns:
this
builder for use in a chained invocation
-
pull
@CanIgnoreReturnValue public final ImmutablePermissions.Builder pull(@Nullable Boolean pull)
Initializes the value for thepull
attribute.- Parameters:
pull
- The value for pull (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutablePermissions build()
Builds a newImmutablePermissions
.- Returns:
- An immutable instance of Permissions
- Throws:
IllegalStateException
- if any required attributes are missing
-
-