Package com.tuladb
Record Class Models.AccountKey
java.lang.Object
java.lang.Record
com.tuladb.Models.AccountKey
- Enclosing class:
Models
public static record Models.AccountKey(int ledgerId, int currency, long idHi, long idLo)
extends Record
An account's identity on wire version 3: (ledgerId, currency, id).
One business id holds one balance per currency, and the ledger is the
tenant boundary, so every account-addressed call names all three. A key
that names no account answers ERR_NOT_FOUND, never another key's
account. Encoded as WireAccountKey {u32 ledger_id; u32 currency; u64
reserved = 0; u128 id} (32 bytes). Keyed calls take this type, never a
bare id. ledgerId and currency are u32 on the wire (Java
int, read unsigned).
-
Constructor Summary
ConstructorsConstructorDescriptionAccountKey(int ledgerId, int currency, long idHi, long idLo) Creates an instance of aAccountKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcurrency()Returns the value of thecurrencyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longidHi()Returns the value of theidHirecord component.longidLo()Returns the value of theidLorecord component.intledgerId()Returns the value of theledgerIdrecord component.static Models.AccountKeyof(int ledgerId, int currency, long idLo) Key for an id that fits in 64 bits (unsigned).static Models.AccountKeyThe key of the accountacreates.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AccountKey
public AccountKey(int ledgerId, int currency, long idHi, long idLo) Creates an instance of aAccountKeyrecord class.- Parameters:
ledgerId- the value for theledgerIdrecord componentcurrency- the value for thecurrencyrecord componentidHi- the value for theidHirecord componentidLo- the value for theidLorecord component
-
-
Method Details
-
of
Key for an id that fits in 64 bits (unsigned). -
of
The key of the accountacreates. -
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 '=='. -
ledgerId
public int ledgerId()Returns the value of theledgerIdrecord component.- Returns:
- the value of the
ledgerIdrecord component
-
currency
public int currency()Returns the value of thecurrencyrecord component.- Returns:
- the value of the
currencyrecord component
-
idHi
public long idHi()Returns the value of theidHirecord component.- Returns:
- the value of the
idHirecord component
-
idLo
public long idLo()Returns the value of theidLorecord component.- Returns:
- the value of the
idLorecord component
-