Package org.stellar.sdk.xdr
Class XdrUnsignedHyperInteger
java.lang.Object
org.stellar.sdk.xdr.XdrUnsignedHyperInteger
- All Implemented Interfaces:
XdrElement
Represents XDR Unsigned Hyper Integer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigIntegerLargest value representable by XDR unsigned hyper integer.static final BigIntegerSmallest value representable by XDR unsigned hyper integer.Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionXdrUnsignedHyperInteger(Long number) Creates anXdrUnsignedHyperIntegerfrom a non-negativeLong.XdrUnsignedHyperInteger(BigInteger number) Creates anXdrUnsignedHyperIntegerfrom aBigInteger. -
Method Summary
Modifier and TypeMethodDescriptionstatic XdrUnsignedHyperIntegerdecode(XdrDataInputStream stream) Decodes anXdrUnsignedHyperIntegerfrom the provided stream using the default maximum depth.static XdrUnsignedHyperIntegerdecode(XdrDataInputStream stream, int maxDepth) Decodes anXdrUnsignedHyperIntegerfrom the provided stream.voidencode(XdrDataOutputStream stream) Encodes this value to XDR.booleanstatic XdrUnsignedHyperIntegerParses anXdrUnsignedHyperIntegerfrom JSON.static XdrUnsignedHyperIntegerfromXdrBase64(String xdr) Decodes anXdrUnsignedHyperIntegerfrom a base64-encoded XDR string.static XdrUnsignedHyperIntegerfromXdrByteArray(byte[] xdr) Decodes anXdrUnsignedHyperIntegerfrom raw XDR bytes.Numeric value stored by this XDR unsigned hyper integer.inthashCode()toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Field Details
-
MAX_VALUE
Largest value representable by XDR unsigned hyper integer. -
MIN_VALUE
Smallest value representable by XDR unsigned hyper integer.
-
-
Constructor Details
-
XdrUnsignedHyperInteger
Creates anXdrUnsignedHyperIntegerfrom aBigInteger.- Parameters:
number- the unsigned 64-bit value- Throws:
IllegalArgumentException- ifnumberis outside the valid range
-
XdrUnsignedHyperInteger
Creates anXdrUnsignedHyperIntegerfrom a non-negativeLong.- Parameters:
number- the unsigned 64-bit value- Throws:
IllegalArgumentException- ifnumberis negative
-
-
Method Details
-
encode
Encodes this value to XDR.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
public static XdrUnsignedHyperInteger decode(XdrDataInputStream stream, int maxDepth) throws IOException Decodes anXdrUnsignedHyperIntegerfrom the provided stream.- Parameters:
stream- the source XDR input streammaxDepth- the maximum decoding depth, ignored for this leaf type- Returns:
- the decoded
XdrUnsignedHyperInteger - Throws:
IOException- if an I/O error occurs while reading the value
-
decode
Decodes anXdrUnsignedHyperIntegerfrom the provided stream using the default maximum depth.- Parameters:
stream- the source XDR input stream- Returns:
- the decoded
XdrUnsignedHyperInteger - Throws:
IOException- if an I/O error occurs while reading the value
-
toJson
Serializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
Parses anXdrUnsignedHyperIntegerfrom JSON.- Parameters:
json- the JSON representation- Returns:
- the parsed
XdrUnsignedHyperInteger, ornullif the input isnull - Throws:
IllegalArgumentException- if the JSON value is invalid
-
fromXdrBase64
Decodes anXdrUnsignedHyperIntegerfrom a base64-encoded XDR string.- Parameters:
xdr- the base64-encoded XDR string- Returns:
- the decoded
XdrUnsignedHyperInteger - Throws:
IOException- if the input is invalid or cannot be decoded
-
fromXdrByteArray
Decodes anXdrUnsignedHyperIntegerfrom raw XDR bytes.- Parameters:
xdr- the raw XDR bytes- Returns:
- the decoded
XdrUnsignedHyperInteger - Throws:
IOException- if the input is invalid or cannot be decoded
-
getNumber
Numeric value stored by this XDR unsigned hyper integer.- Returns:
- the unsigned 64-bit value
-
equals
-
hashCode
public int hashCode() -
toString
-