Package dev.twilite.game.common
Record Class RealTimePrice
java.lang.Object
java.lang.Record
dev.twilite.game.common.RealTimePrice
Real-time buy and sell prices for an item.
-
Constructor Summary
ConstructorsConstructorDescriptionRealTimePrice(int high, int low, long highTime, long lowTime) Creates an instance of aRealTimePricerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthigh()Returns the value of thehighrecord component.longhighTime()Returns the value of thehighTimerecord component.intlow()Returns the value of thelowrecord component.longlowTime()Returns the value of thelowTimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RealTimePrice
public RealTimePrice(int high, int low, long highTime, long lowTime) Creates an instance of aRealTimePricerecord class.- Parameters:
high- the value for thehighrecord componentlow- the value for thelowrecord componenthighTime- the value for thehighTimerecord componentlowTime- the value for thelowTimerecord component
-
-
Method Details
-
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. -
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 '=='. -
high
public int high()Returns the value of thehighrecord component.- Returns:
- the value of the
highrecord component
-
low
public int low()Returns the value of thelowrecord component.- Returns:
- the value of the
lowrecord component
-
highTime
public long highTime()Returns the value of thehighTimerecord component.- Returns:
- the value of the
highTimerecord component
-
lowTime
public long lowTime()Returns the value of thelowTimerecord component.- Returns:
- the value of the
lowTimerecord component
-