Package com.spotify.github.v3.repos
Class ImmutableProtection
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableProtection
-
- All Implemented Interfaces:
Protection
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProtection extends Object implements Protection
Immutable implementation ofProtection
.Use the builder to create immutable instances:
ImmutableProtection.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableProtection.Builder
Builds instances of typeImmutableProtection
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableProtection.Builder
builder()
Creates a builder forImmutableProtection
.static ImmutableProtection
copyOf(Protection instance)
Creates an immutable copy of aProtection
value.boolean
enabled()
boolean
equals(Object another)
This instance is equal to all instances ofImmutableProtection
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:enabled
,requiredStatusChecks
.RequiredStatusChecks
requiredStatusChecks()
String
toString()
Prints the immutable valueProtection
with attribute values.ImmutableProtection
withEnabled(boolean value)
Copy the current immutable object by setting a value for theenabled
attribute.ImmutableProtection
withRequiredStatusChecks(RequiredStatusChecks value)
Copy the current immutable object by setting a value for therequiredStatusChecks
attribute.
-
-
-
Method Detail
-
enabled
public boolean enabled()
- Specified by:
enabled
in interfaceProtection
- Returns:
- The value of the
enabled
attribute
-
requiredStatusChecks
public RequiredStatusChecks requiredStatusChecks()
- Specified by:
requiredStatusChecks
in interfaceProtection
- Returns:
- The value of the
requiredStatusChecks
attribute
-
withEnabled
public final ImmutableProtection withEnabled(boolean value)
Copy the current immutable object by setting a value for theenabled
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for enabled- Returns:
- A modified copy of the
this
object
-
withRequiredStatusChecks
public final ImmutableProtection withRequiredStatusChecks(RequiredStatusChecks value)
Copy the current immutable object by setting a value for therequiredStatusChecks
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for requiredStatusChecks- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableProtection
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:enabled
,requiredStatusChecks
.
-
toString
public String toString()
Prints the immutable valueProtection
with attribute values.
-
copyOf
public static ImmutableProtection copyOf(Protection instance)
Creates an immutable copy of aProtection
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 Protection instance
-
builder
public static ImmutableProtection.Builder builder()
Creates a builder forImmutableProtection
.ImmutableProtection.builder() .enabled(boolean) // required
enabled
.requiredStatusChecks(com.spotify.github.v3.repos.RequiredStatusChecks) // requiredrequiredStatusChecks
.build();- Returns:
- A new ImmutableProtection builder
-
-