public class Price extends Object implements ByteTransformable
| Constructor and Description |
|---|
Price(Asset base,
Asset quote)
Create a new price object by providing a base and a
quote asset.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object otherObject) |
Asset |
getBase() |
Asset |
getQuote() |
int |
hashCode() |
Asset |
multiply(Asset asset)
Multiply this price instance with an
Asset instance. |
void |
setBase(Asset base) |
void |
setQuote(Asset quote) |
byte[] |
toByteArray()
Covert the operation into a byte array.
|
String |
toString() |
public Price(Asset base, Asset quote)
base - Represents a value of the Price object to be
expressed relatively to quote asset.quote - Represents an relative asset.InvalidParameterException - If the base, the quote or both
objects have not been provided, contain the same symbol or
have an amount less than 1.public Asset getBase()
public void setBase(Asset base)
base - The base asset to set.InvalidParameterException - If the base, the quote or both
objects have not been provided, contain the same symbol or
have an amount less than 1.public Asset getQuote()
public void setQuote(Asset quote)
quote - The quote asset to set.InvalidParameterException - If the base, the quote or both
objects have not been provided, contain the same symbol or
have an amount less than 1.public Asset multiply(Asset asset)
Asset instance.asset - The asset to multiply.asset multiplied with this price.public byte[] toByteArray()
throws BeowulfInvalidTransactionException
ByteTransformabletoByteArray in interface ByteTransformableBeowulfInvalidTransactionException - If there was a problem while transforming the transaction
into a byte array.Copyright © 2019. All rights reserved.