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
-
Nested Class Summary
Nested classes/interfaces inherited from interface TemperatureStatus
TemperatureStatus.Builder -
Field Summary
FieldsFields inherited from interface TemperatureStatus
CODEC, DIRECT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionTemperatureStatusImpl(@NotNull TemperatureStatusSelector selector, @Range(from=1L,to=2147483647L) int interval, boolean enabledByDefault, @NotNull List<TemperatureEffect> effects) Creates an instance of aTemperatureStatusImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(net.minecraft.world.entity.LivingEntity entity, TemperatureEffectContext context) @NotNull List<TemperatureEffect> effects()Returns the value of theeffectsrecord component.booleanReturns the value of theenabledByDefaultrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Range(from=1L,to=2147483647L) intinterval()Returns the value of theintervalrecord component.voidremove(net.minecraft.world.entity.LivingEntity entity, TemperatureEffectContext context) @NotNull TemperatureStatusSelectorselector()Returns the value of theselectorrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_INTERVAL
public static final int DEFAULT_INTERVAL- See Also:
-
-
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 aTemperatureStatusImplrecord class.- Parameters:
selector- the value for theselectorrecord componentinterval- the value for theintervalrecord componentenabledByDefault- the value for theenabledByDefaultrecord componenteffects- the value for theeffectsrecord 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
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
selector
Returns the value of theselectorrecord component.- Specified by:
selectorin interfaceTemperatureStatus- Returns:
- the value of the
selectorrecord component
-
interval
public @Range(from=1L,to=2147483647L) int interval()Returns the value of theintervalrecord component.- Specified by:
intervalin interfaceTemperatureStatus- Returns:
- the value of the
intervalrecord component
-
enabledByDefault
public boolean enabledByDefault()Returns the value of theenabledByDefaultrecord component.- Specified by:
enabledByDefaultin interfaceTemperatureStatus- Returns:
- the value of the
enabledByDefaultrecord component
-
effects
Returns the value of theeffectsrecord component.- Specified by:
effectsin interfaceTemperatureStatus- Returns:
- the value of the
effectsrecord component
-