Class ImmutableCooldownInstance
java.lang.Object
org.incendo.cloud.processors.cooldown.ImmutableCooldownInstance
- All Implemented Interfaces:
CooldownInstance
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCooldownInstance
extends Object
implements CooldownInstance
Immutable implementation of
CooldownInstance.
Use the builder to create immutable instances:
ImmutableCooldownInstance.builder().
Use the static factory method to create immutable instances:
ImmutableCooldownInstance.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableCooldownInstance.static interfacestatic interfacestatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableCooldownInstance.static ImmutableCooldownInstancecopyOf(CooldownInstance instance) Creates an immutable copy of aCooldownInstancevalue.Returns the creation time.duration()Returns the cooldown duration.booleanThis instance is equal to all instances ofImmutableCooldownInstancethat have equal attribute values.group()Returns the cooldown group.inthashCode()Computes a hash code from attributes:profile,group,duration,creationTime.static ImmutableCooldownInstanceof(@NonNull CooldownProfile profile, @NonNull CooldownGroup group, @NonNull Duration duration, @NonNull Instant creationTime) Construct a new immutableCooldownInstanceinstance.profile()Returns the profile that owns the cooldown.toString()Prints the immutable valueCooldownInstancewith attribute values.withCreationTime(@NonNull Instant value) Copy the current immutable object by setting a value for thecreationTimeattribute.withDuration(@NonNull Duration value) Copy the current immutable object by setting a value for thedurationattribute.withGroup(@NonNull CooldownGroup value) Copy the current immutable object by setting a value for thegroupattribute.withProfile(@NonNull CooldownProfile value) Copy the current immutable object by setting a value for theprofileattribute.
-
Method Details
-
profile
Returns the profile that owns the cooldown.- Specified by:
profilein interfaceCooldownInstance- Returns:
- the owning profile
-
group
Returns the cooldown group.- Specified by:
groupin interfaceCooldownInstance- Returns:
- the group
-
duration
Returns the cooldown duration.- Specified by:
durationin interfaceCooldownInstance- Returns:
- the duration
-
creationTime
Returns the creation time.- Specified by:
creationTimein interfaceCooldownInstance- Returns:
- the creation time
-
withProfile
Copy the current immutable object by setting a value for theprofileattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for profile- Returns:
- A modified copy of the
thisobject
-
withGroup
Copy the current immutable object by setting a value for thegroupattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for group- Returns:
- A modified copy of the
thisobject
-
withDuration
Copy the current immutable object by setting a value for thedurationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for duration- Returns:
- A modified copy of the
thisobject
-
withCreationTime
Copy the current immutable object by setting a value for thecreationTimeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for creationTime- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableCooldownInstancethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:profile,group,duration,creationTime. -
toString
Prints the immutable valueCooldownInstancewith attribute values. -
of
public static ImmutableCooldownInstance of(@NonNull CooldownProfile profile, @NonNull CooldownGroup group, @NonNull Duration duration, @NonNull Instant creationTime) Construct a new immutableCooldownInstanceinstance.- Parameters:
profile- The value for theprofileattributegroup- The value for thegroupattributeduration- The value for thedurationattributecreationTime- The value for thecreationTimeattribute- Returns:
- An immutable CooldownInstance instance
-
copyOf
Creates an immutable copy of aCooldownInstancevalue. 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 CooldownInstance instance
-
builder
Creates a builder forImmutableCooldownInstance.ImmutableCooldownInstance.builder() .profile(org.incendo.cloud.processors.cooldown.profile.@org.checkerframework.checker.nullness.qual.NonNull CooldownProfile) // requiredprofile.group(org.incendo.cloud.processors.cooldown.@org.checkerframework.checker.nullness.qual.NonNull CooldownGroup) // requiredgroup.duration(java.time.@org.checkerframework.checker.nullness.qual.NonNull Duration) // requiredduration.creationTime(java.time.@org.checkerframework.checker.nullness.qual.NonNull Instant) // requiredcreationTime.build();- Returns:
- A new ImmutableCooldownInstance builder
-