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 classImmutablePermissions.BuilderBuilds instances of typeImmutablePermissions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleanadmin()Has adminstatic ImmutablePermissions.Builderbuilder()Creates a builder forImmutablePermissions.static ImmutablePermissionscopyOf(Permissions instance)Creates an immutable copy of aPermissionsvalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePermissionsthat have equal attribute values.inthashCode()Computes a hash code from attributes:admin,push,pull.Booleanpull()Can pullBooleanpush()Can pushStringtoString()Prints the immutable valuePermissionswith attribute values.ImmutablePermissionswithAdmin(Boolean value)Copy the current immutable object by setting a value for theadminattribute.ImmutablePermissionswithPull(Boolean value)Copy the current immutable object by setting a value for thepullattribute.ImmutablePermissionswithPush(Boolean value)Copy the current immutable object by setting a value for thepushattribute.
-
-
-
Method Detail
-
admin
@Nullable public Boolean admin()
Has admin- Specified by:
adminin interfacePermissions
-
push
@Nullable public Boolean push()
Can push- Specified by:
pushin interfacePermissions
-
pull
@Nullable public Boolean pull()
Can pull- Specified by:
pullin interfacePermissions
-
withAdmin
public final ImmutablePermissions withAdmin(@Nullable Boolean value)
Copy the current immutable object by setting a value for theadminattribute. 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
thisobject
-
withPush
public final ImmutablePermissions withPush(@Nullable Boolean value)
Copy the current immutable object by setting a value for thepushattribute. 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
thisobject
-
withPull
public final ImmutablePermissions withPull(@Nullable Boolean value)
Copy the current immutable object by setting a value for thepullattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutablePermissionsthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:admin,push,pull.
-
toString
public String toString()
Prints the immutable valuePermissionswith attribute values.
-
copyOf
public static ImmutablePermissions copyOf(Permissions instance)
Creates an immutable copy of aPermissionsvalue. 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) // nullableadmin.push(Boolean | null) // nullablepush.pull(Boolean | null) // nullablepull.build();- Returns:
- A new ImmutablePermissions builder
-
-