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 classImmutableProtection.BuilderBuilds instances of typeImmutableProtection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableProtection.Builderbuilder()Creates a builder forImmutableProtection.static ImmutableProtectioncopyOf(Protection instance)Creates an immutable copy of aProtectionvalue.booleanenabled()booleanequals(Object another)This instance is equal to all instances ofImmutableProtectionthat have equal attribute values.inthashCode()Computes a hash code from attributes:enabled,requiredStatusChecks.RequiredStatusChecksrequiredStatusChecks()StringtoString()Prints the immutable valueProtectionwith attribute values.ImmutableProtectionwithEnabled(boolean value)Copy the current immutable object by setting a value for theenabledattribute.ImmutableProtectionwithRequiredStatusChecks(RequiredStatusChecks value)Copy the current immutable object by setting a value for therequiredStatusChecksattribute.
-
-
-
Method Detail
-
enabled
public boolean enabled()
- Specified by:
enabledin interfaceProtection- Returns:
- The value of the
enabledattribute
-
requiredStatusChecks
public RequiredStatusChecks requiredStatusChecks()
- Specified by:
requiredStatusChecksin interfaceProtection- Returns:
- The value of the
requiredStatusChecksattribute
-
withEnabled
public final ImmutableProtection withEnabled(boolean value)
Copy the current immutable object by setting a value for theenabledattribute. 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
thisobject
-
withRequiredStatusChecks
public final ImmutableProtection withRequiredStatusChecks(RequiredStatusChecks value)
Copy the current immutable object by setting a value for therequiredStatusChecksattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableProtectionthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:enabled,requiredStatusChecks.
-
toString
public String toString()
Prints the immutable valueProtectionwith attribute values.
-
copyOf
public static ImmutableProtection copyOf(Protection instance)
Creates an immutable copy of aProtectionvalue. 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) // requiredenabled.requiredStatusChecks(com.spotify.github.v3.repos.RequiredStatusChecks) // requiredrequiredStatusChecks.build();- Returns:
- A new ImmutableProtection builder
-
-