Record Class TransactionResult
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.economy.TransactionResult
public record TransactionResult(UUID id, Instant timestamp, TransactionStatus status, EconomyContext context, Account source, Account target, Currency currency, BigDecimal amount, BigDecimal newBalance, net.kyori.adventure.text.Component reason, net.kyori.adventure.text.Component error)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionResult(UUID id, Instant timestamp, TransactionStatus status, EconomyContext context, Account source, Account target, Currency currency, BigDecimal amount, BigDecimal newBalance, net.kyori.adventure.text.Component reason, net.kyori.adventure.text.Component error) Creates an instance of aTransactionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.context()Returns the value of thecontextrecord component.currency()Returns the value of thecurrencyrecord component.final booleanIndicates whether some other object is "equal to" this one.net.kyori.adventure.text.Componenterror()Returns the value of theerrorrecord component.static TransactionResultfailure(TransactionStatus status, EconomyContext context, Account source, Account target, Currency currency, net.kyori.adventure.text.Component error) final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanReturns the value of thenewBalancerecord component.net.kyori.adventure.text.Componentreason()Returns the value of thereasonrecord component.source()Returns the value of thesourcerecord component.status()Returns the value of thestatusrecord component.static TransactionResultsuccess(EconomyContext context, Account source, Account target, Currency currency, BigDecimal amount, BigDecimal newBalance, net.kyori.adventure.text.Component reason) target()Returns the value of thetargetrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TransactionResult
public TransactionResult(UUID id, Instant timestamp, TransactionStatus status, EconomyContext context, Account source, Account target, Currency currency, BigDecimal amount, BigDecimal newBalance, net.kyori.adventure.text.Component reason, net.kyori.adventure.text.Component error) Creates an instance of aTransactionResultrecord class.- Parameters:
id- the value for theidrecord componenttimestamp- the value for thetimestamprecord componentstatus- the value for thestatusrecord componentcontext- the value for thecontextrecord componentsource- the value for thesourcerecord componenttarget- the value for thetargetrecord componentcurrency- the value for thecurrencyrecord componentamount- the value for theamountrecord componentnewBalance- the value for thenewBalancerecord componentreason- the value for thereasonrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
isSuccess
public boolean isSuccess() -
success
public static TransactionResult success(EconomyContext context, Account source, Account target, Currency currency, BigDecimal amount, BigDecimal newBalance, net.kyori.adventure.text.Component reason) -
failure
public static TransactionResult failure(TransactionStatus status, EconomyContext context, Account source, Account target, Currency currency, net.kyori.adventure.text.Component error) -
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
currency
Returns the value of thecurrencyrecord component.- Returns:
- the value of the
currencyrecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
newBalance
Returns the value of thenewBalancerecord component.- Returns:
- the value of the
newBalancerecord component
-
reason
public net.kyori.adventure.text.Component reason()Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
error
public net.kyori.adventure.text.Component error()Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-