Package org.stellar.sdk.xdr
Class Price
java.lang.Object
org.stellar.sdk.xdr.Price
- All Implemented Interfaces:
XdrElement
Price's original definition in the XDR file is:
struct Price
{
int32 n; // numerator
int32 d; // denominator
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Price.PriceBuilderbuilder()static Pricedecode(XdrDataInputStream stream) static Pricedecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic Pricestatic PricefromXdrBase64(String xdr) static PricefromXdrByteArray(byte[] xdr) getD()Value of thedfield.getN()Value of thenfield.inthashCode()voidValue of thedfield.voidValue of thenfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
Price
public Price() -
Price
Creates a newPriceinstance.- Parameters:
n- thenfield valued- thedfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getN
Value of thenfield.- Returns:
- the
nfield value
-
getD
Value of thedfield.- Returns:
- the
dfield value
-
setN
Value of thenfield.- Parameters:
n- thenfield value
-
setD
Value of thedfield.- Parameters:
d- thedfield value
-
equals
-
hashCode
public int hashCode() -
toString
-