Package markets.alpaca.client.ws.model
Record Class CryptoQuote
java.lang.Object
java.lang.Record
markets.alpaca.client.ws.model.CryptoQuote
- Record Components:
symbol- crypto pair symbol (e.g."BTC/USD")bidPrice- best bid pricebidSize- best bid sizeaskPrice- best ask priceaskSize- best ask sizetimestamp- RFC-3339 timestamp with nanosecond precision
public record CryptoQuote(String symbol, BigDecimal bidPrice, BigDecimal bidSize, BigDecimal askPrice, BigDecimal askSize, String timestamp)
extends Record
A top-of-book quote from the Alpaca crypto exchange order book (
T: "q").-
Constructor Summary
ConstructorsConstructorDescriptionCryptoQuote(String symbol, BigDecimal bidPrice, BigDecimal bidSize, BigDecimal askPrice, BigDecimal askSize, String timestamp) Creates an instance of aCryptoQuoterecord class. -
Method Summary
Modifier and TypeMethodDescriptionaskPrice()Returns the value of theaskPricerecord component.askSize()Returns the value of theaskSizerecord component.bidPrice()Returns the value of thebidPricerecord component.bidSize()Returns the value of thebidSizerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.symbol()Returns the value of thesymbolrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CryptoQuote
public CryptoQuote(String symbol, BigDecimal bidPrice, BigDecimal bidSize, BigDecimal askPrice, BigDecimal askSize, String timestamp) Creates an instance of aCryptoQuoterecord class.- Parameters:
symbol- the value for thesymbolrecord componentbidPrice- the value for thebidPricerecord componentbidSize- the value for thebidSizerecord componentaskPrice- the value for theaskPricerecord componentaskSize- the value for theaskSizerecord componenttimestamp- the value for thetimestamprecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
symbol
Returns the value of thesymbolrecord component.- Returns:
- the value of the
symbolrecord component
-
bidPrice
Returns the value of thebidPricerecord component.- Returns:
- the value of the
bidPricerecord component
-
bidSize
Returns the value of thebidSizerecord component.- Returns:
- the value of the
bidSizerecord component
-
askPrice
Returns the value of theaskPricerecord component.- Returns:
- the value of the
askPricerecord component
-
askSize
Returns the value of theaskSizerecord component.- Returns:
- the value of the
askSizerecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-