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().

  • Method Details

    • profile

      public @NonNull CooldownProfile profile()
      Returns the profile that owns the cooldown.
      Specified by:
      profile in interface CooldownInstance
      Returns:
      the owning profile
    • group

      public @NonNull CooldownGroup group()
      Returns the cooldown group.
      Specified by:
      group in interface CooldownInstance
      Returns:
      the group
    • duration

      public @NonNull Duration duration()
      Returns the cooldown duration.
      Specified by:
      duration in interface CooldownInstance
      Returns:
      the duration
    • creationTime

      public @NonNull Instant creationTime()
      Returns the creation time.
      Specified by:
      creationTime in interface CooldownInstance
      Returns:
      the creation time
    • withProfile

      public final ImmutableCooldownInstance withProfile(@NonNull CooldownProfile value)
      Copy the current immutable object by setting a value for the profile attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for profile
      Returns:
      A modified copy of the this object
    • withGroup

      public final ImmutableCooldownInstance withGroup(@NonNull CooldownGroup value)
      Copy the current immutable object by setting a value for the group attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for group
      Returns:
      A modified copy of the this object
    • withDuration

      public final ImmutableCooldownInstance withDuration(@NonNull Duration value)
      Copy the current immutable object by setting a value for the duration attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for duration
      Returns:
      A modified copy of the this object
    • withCreationTime

      public final ImmutableCooldownInstance withCreationTime(@NonNull Instant value)
      Copy the current immutable object by setting a value for the creationTime attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for creationTime
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCooldownInstance that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: profile, group, duration, creationTime.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value CooldownInstance with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableCooldownInstance of(@NonNull CooldownProfile profile, @NonNull CooldownGroup group, @NonNull Duration duration, @NonNull Instant creationTime)
      Construct a new immutable CooldownInstance instance.
      Parameters:
      profile - The value for the profile attribute
      group - The value for the group attribute
      duration - The value for the duration attribute
      creationTime - The value for the creationTime attribute
      Returns:
      An immutable CooldownInstance instance
    • copyOf

      public static ImmutableCooldownInstance copyOf(CooldownInstance instance)
      Creates an immutable copy of a CooldownInstance 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 CooldownInstance instance
    • builder

      Creates a builder for ImmutableCooldownInstance.
       ImmutableCooldownInstance.builder()
          .profile(org.incendo.cloud.processors.cooldown.profile.@org.checkerframework.checker.nullness.qual.NonNull CooldownProfile) // required profile
          .group(org.incendo.cloud.processors.cooldown.@org.checkerframework.checker.nullness.qual.NonNull CooldownGroup) // required group
          .duration(java.time.@org.checkerframework.checker.nullness.qual.NonNull Duration) // required duration
          .creationTime(java.time.@org.checkerframework.checker.nullness.qual.NonNull Instant) // required creationTime
          .build();
       
      Returns:
      A new ImmutableCooldownInstance builder