Record Class TemperatureStatusImpl

java.lang.Object
java.lang.Record
com.github.thedeathlycow.thermoo.impl.temperature.status.TemperatureStatusImpl
All Implemented Interfaces:
TemperatureStatus

public record TemperatureStatusImpl(@NotNull TemperatureStatusSelector selector, @Range(from=1L,to=2147483647L) int interval, boolean enabledByDefault, @NotNull List<TemperatureEffect> effects) extends Record implements TemperatureStatus
  • Field Details

  • Constructor Details

    • TemperatureStatusImpl

      public TemperatureStatusImpl(@NotNull @NotNull TemperatureStatusSelector selector, @Range(from=1L,to=2147483647L) int interval, boolean enabledByDefault, @NotNull @NotNull List<TemperatureEffect> effects)
      Creates an instance of a TemperatureStatusImpl record class.
      Parameters:
      selector - the value for the selector record component
      interval - the value for the interval record component
      enabledByDefault - the value for the enabledByDefault record component
      effects - the value for the effects record component
  • Method Details

    • apply

      public boolean apply(net.minecraft.world.entity.LivingEntity entity, TemperatureEffectContext context)
    • remove

      public void remove(net.minecraft.world.entity.LivingEntity entity, TemperatureEffectContext context)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • selector

      @NotNull public @NotNull TemperatureStatusSelector selector()
      Returns the value of the selector record component.
      Specified by:
      selector in interface TemperatureStatus
      Returns:
      the value of the selector record component
    • interval

      public @Range(from=1L,to=2147483647L) int interval()
      Returns the value of the interval record component.
      Specified by:
      interval in interface TemperatureStatus
      Returns:
      the value of the interval record component
    • enabledByDefault

      public boolean enabledByDefault()
      Returns the value of the enabledByDefault record component.
      Specified by:
      enabledByDefault in interface TemperatureStatus
      Returns:
      the value of the enabledByDefault record component
    • effects

      @NotNull public @NotNull List<TemperatureEffect> effects()
      Returns the value of the effects record component.
      Specified by:
      effects in interface TemperatureStatus
      Returns:
      the value of the effects record component