Package com.tnsai.llm.cost
Record Class BudgetManager.BudgetStatus
java.lang.Object
java.lang.Record
com.tnsai.llm.cost.BudgetManager.BudgetStatus
- Enclosing class:
BudgetManager
public static record BudgetManager.BudgetStatus(BudgetManager.BudgetState state, BigDecimal currentSpend, BigDecimal limit, BigDecimal remaining, double usagePercent, Instant periodStart, Duration remainingTime)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionBudgetStatus(BudgetManager.BudgetState state, BigDecimal currentSpend, BigDecimal limit, BigDecimal remaining, double usagePercent, Instant periodStart, Duration remainingTime) Creates an instance of aBudgetStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrentSpendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.limit()Returns the value of thelimitrecord component.Returns the value of theperiodStartrecord component.Returns the value of theremainingrecord component.Returns the value of theremainingTimerecord component.state()Returns the value of thestaterecord component.toString()Returns a string representation of this record class.doubleReturns the value of theusagePercentrecord component.
-
Constructor Details
-
BudgetStatus
public BudgetStatus(BudgetManager.BudgetState state, BigDecimal currentSpend, BigDecimal limit, BigDecimal remaining, double usagePercent, Instant periodStart, Duration remainingTime) Creates an instance of aBudgetStatusrecord class.- Parameters:
state- the value for thestaterecord componentcurrentSpend- the value for thecurrentSpendrecord componentlimit- the value for thelimitrecord componentremaining- the value for theremainingrecord componentusagePercent- the value for theusagePercentrecord componentperiodStart- the value for theperiodStartrecord componentremainingTime- the value for theremainingTimerecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
currentSpend
Returns the value of thecurrentSpendrecord component.- Returns:
- the value of the
currentSpendrecord component
-
limit
Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-
remaining
Returns the value of theremainingrecord component.- Returns:
- the value of the
remainingrecord component
-
usagePercent
public double usagePercent()Returns the value of theusagePercentrecord component.- Returns:
- the value of the
usagePercentrecord component
-
periodStart
Returns the value of theperiodStartrecord component.- Returns:
- the value of the
periodStartrecord component
-
remainingTime
Returns the value of theremainingTimerecord component.- Returns:
- the value of the
remainingTimerecord component
-