Record Class SpentOutput
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.indicators.onchain.model.SpentOutput
- Record Components:
valueAtCreation- USD value when the output was receivedvalueAtSpending- USD value when the output was spentcreatedAt- timestamp when the output was createdspentAt- timestamp when the output was spent
-
Constructor Summary
ConstructorsConstructorDescriptionSpentOutput(double valueAtCreation, double valueAtSpending, Instant createdAt, Instant spentAt) Creates an instance of aSpentOutputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true if this output was spent at a profit.lifespan()Returns the lifespan of this output (time between creation and spending).spentAt()Returns the value of thespentAtrecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thevalueAtCreationrecord component.doubleReturns the value of thevalueAtSpendingrecord component.
-
Constructor Details
-
SpentOutput
public SpentOutput(double valueAtCreation, double valueAtSpending, Instant createdAt, Instant spentAt) Creates an instance of aSpentOutputrecord class.- Parameters:
valueAtCreation- the value for thevalueAtCreationrecord componentvalueAtSpending- the value for thevalueAtSpendingrecord componentcreatedAt- the value for thecreatedAtrecord componentspentAt- the value for thespentAtrecord component
-
-
Method Details
-
lifespan
Returns the lifespan of this output (time between creation and spending). -
isProfitable
public boolean isProfitable()Returns true if this output was spent at a profit. -
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. -
valueAtCreation
public double valueAtCreation()Returns the value of thevalueAtCreationrecord component.- Returns:
- the value of the
valueAtCreationrecord component
-
valueAtSpending
public double valueAtSpending()Returns the value of thevalueAtSpendingrecord component.- Returns:
- the value of the
valueAtSpendingrecord component
-
createdAt
-
spentAt
-