Package dev.latvian.mods.kubejs.util
Record Class TickDuration
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.util.TickDuration
- All Implemented Interfaces:
TemporalAmount
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TickDuration> static final com.mojang.serialization.Codec<TickDuration> static final com.mojang.serialization.Codec<TickDuration> static final com.mojang.serialization.Codec<TickDuration> static final dev.latvian.mods.rhino.type.TypeInfostatic final TickDuration -
Constructor Summary
ConstructorsConstructorDescriptionTickDuration(long ticks) Creates an instance of aTickDurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longget(TemporalUnit unit) getUnits()final inthashCode()Returns a hash code value for this object.intintTicks()static TickDurationof(long ticks) subtractFrom(Temporal temporal) longticks()Returns the value of theticksrecord component.toString()Returns a string representation of this record class.static TickDuration
-
Field Details
-
ZERO
-
CODEC
-
SECONDS_CODEC
-
MINUTES_CODEC
-
HOURS_CODEC
-
TYPE_INFO
public static final dev.latvian.mods.rhino.type.TypeInfo TYPE_INFO
-
-
Constructor Details
-
TickDuration
public TickDuration(long ticks) Creates an instance of aTickDurationrecord class.- Parameters:
ticks- the value for theticksrecord component
-
-
Method Details
-
of
-
wrap
-
get
- Specified by:
getin interfaceTemporalAmount
-
getUnits
- Specified by:
getUnitsin interfaceTemporalAmount
-
addTo
- Specified by:
addToin interfaceTemporalAmount
-
subtractFrom
- Specified by:
subtractFromin interfaceTemporalAmount
-
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. -
intTicks
public int intTicks() -
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. -
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. All components in this record class are compared with '=='. -
ticks
public long ticks()Returns the value of theticksrecord component.- Returns:
- the value of the
ticksrecord component
-