Package com.patelheet.capitalengine.api
Record Class TxResult
java.lang.Object
java.lang.Record
com.patelheet.capitalengine.api.TxResult
- Record Components:
success- whether the transaction was appliedtxId- the transaction id (the existing one forFailure.DUPLICATE_REFERENCE), or 0failure-Failure.NONEon successmessage- short plain-language reason, safe to show playersfromTreasury- part of aserverPaypaid from the Treasuryissued- part of aserverPayorissuethat was newly created
public record TxResult(boolean success, long txId, Failure failure, String message, long fromTreasury, long issued)
extends Record
Outcome of a mutation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.failure()Returns the value of thefailurerecord component.longReturns the value of thefromTreasuryrecord component.final inthashCode()Returns a hash code value for this object.longissued()Returns the value of theissuedrecord component.message()Returns the value of themessagerecord component.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.longtxId()Returns the value of thetxIdrecord component.
-
Constructor Details
-
TxResult
public TxResult(boolean success, long txId, Failure failure, String message, long fromTreasury, long issued) Creates an instance of aTxResultrecord class.- Parameters:
success- the value for thesuccessrecord componenttxId- the value for thetxIdrecord componentfailure- the value for thefailurerecord componentmessage- the value for themessagerecord componentfromTreasury- the value for thefromTreasuryrecord componentissued- the value for theissuedrecord 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 '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
txId
public long txId()Returns the value of thetxIdrecord component.- Returns:
- the value of the
txIdrecord component
-
failure
Returns the value of thefailurerecord component.- Returns:
- the value of the
failurerecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
fromTreasury
public long fromTreasury()Returns the value of thefromTreasuryrecord component.- Returns:
- the value of the
fromTreasuryrecord component
-
issued
public long issued()Returns the value of theissuedrecord component.- Returns:
- the value of the
issuedrecord component
-