Package net.osslabz.crypto
Record Class TradingAsset
java.lang.Object
java.lang.Record
net.osslabz.crypto.TradingAsset
- Record Components:
exchange-currencyPair-
Identifies a trading asset (a currency pair on a specific exchange).
-
Constructor Summary
ConstructorsConstructorDescriptionTradingAsset(Exchange exchange, String baseCurrencyCode, String counterCurrencyCode) TradingAsset(Exchange exchange, CurrencyPair currencyPair) Creates an instance of aTradingAssetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrencyPairrecord component.final booleanIndicates whether some other object is "equal to" this one.exchange()Returns the value of theexchangerecord component.getLabel()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TradingAsset
Creates an instance of aTradingAssetrecord class.- Parameters:
exchange- the value for theexchangerecord componentcurrencyPair- the value for thecurrencyPairrecord component
-
TradingAsset
-
-
Method Details
-
baseCurrencyCode
-
counterCurrencyCode
-
getLabel
-
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 withObjects::equals(Object,Object). -
exchange
Returns the value of theexchangerecord component.- Returns:
- the value of the
exchangerecord component
-
currencyPair
Returns the value of thecurrencyPairrecord component.- Returns:
- the value of the
currencyPairrecord component
-