Package com.spotify.github.v3.repos
Class ImmutablePermissions
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutablePermissions
-
- All Implemented Interfaces:
Permissions
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePermissions extends Object implements Permissions
Immutable implementation ofPermissions
.Use the builder to create immutable instances:
ImmutablePermissions.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutablePermissions.Builder
Builds instances of typeImmutablePermissions
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
admin()
Has adminstatic ImmutablePermissions.Builder
builder()
Creates a builder forImmutablePermissions
.static ImmutablePermissions
copyOf(Permissions instance)
Creates an immutable copy of aPermissions
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutablePermissions
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:admin
,push
,pull
.Boolean
pull()
Can pullBoolean
push()
Can pushString
toString()
Prints the immutable valuePermissions
with attribute values.ImmutablePermissions
withAdmin(Boolean value)
Copy the current immutable object by setting a value for theadmin
attribute.ImmutablePermissions
withPull(Boolean value)
Copy the current immutable object by setting a value for thepull
attribute.ImmutablePermissions
withPush(Boolean value)
Copy the current immutable object by setting a value for thepush
attribute.
-
-
-
Method Detail
-
admin
@Nullable public Boolean admin()
Has admin- Specified by:
admin
in interfacePermissions
-
push
@Nullable public Boolean push()
Can push- Specified by:
push
in interfacePermissions
-
pull
@Nullable public Boolean pull()
Can pull- Specified by:
pull
in interfacePermissions
-
withAdmin
public final ImmutablePermissions withAdmin(@Nullable Boolean value)
Copy the current immutable object by setting a value for theadmin
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for admin (can benull
)- Returns:
- A modified copy of the
this
object
-
withPush
public final ImmutablePermissions withPush(@Nullable Boolean value)
Copy the current immutable object by setting a value for thepush
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for push (can benull
)- Returns:
- A modified copy of the
this
object
-
withPull
public final ImmutablePermissions withPull(@Nullable Boolean value)
Copy the current immutable object by setting a value for thepull
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for pull (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePermissions
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:admin
,push
,pull
.
-
toString
public String toString()
Prints the immutable valuePermissions
with attribute values.
-
copyOf
public static ImmutablePermissions copyOf(Permissions instance)
Creates an immutable copy of aPermissions
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable Permissions instance
-
builder
public static ImmutablePermissions.Builder builder()
Creates a builder forImmutablePermissions
.ImmutablePermissions.builder() .admin(Boolean | null) // nullable
admin
.push(Boolean | null) // nullablepush
.pull(Boolean | null) // nullablepull
.build();- Returns:
- A new ImmutablePermissions builder
-
-