Package org.stellar.sdk.xdr
Class PeerAddress
java.lang.Object
org.stellar.sdk.xdr.PeerAddress
- All Implemented Interfaces:
XdrElement
PeerAddress's original definition in the XDR file is:
struct PeerAddress
{
union switch (IPAddrType type)
{
case IPv4:
opaque ipv4[4];
case IPv6:
opaque ipv6[16];
}
ip;
uint32 port;
uint32 numFailures;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classPeerAddressIp's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionPeerAddress(PeerAddress.PeerAddressIp ip, Uint32 port, Uint32 numFailures) Creates a newPeerAddressinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static PeerAddressdecode(XdrDataInputStream stream) static PeerAddressdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic PeerAddressstatic PeerAddressfromXdrBase64(String xdr) static PeerAddressfromXdrByteArray(byte[] xdr) getIp()Value of theipfield.Value of thenumFailuresfield.getPort()Value of theportfield.inthashCode()voidValue of theipfield.voidsetNumFailures(Uint32 numFailures) Value of thenumFailuresfield.voidValue of theportfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
PeerAddress
public PeerAddress() -
PeerAddress
Creates a newPeerAddressinstance.- Parameters:
ip- theipfield valueport- theportfield valuenumFailures- thenumFailuresfield 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
-
getIp
Value of theipfield.- Returns:
- the
ipfield value
-
getPort
Value of theportfield.- Returns:
- the
portfield value
-
getNumFailures
Value of thenumFailuresfield.- Returns:
- the
numFailuresfield value
-
setIp
Value of theipfield.- Parameters:
ip- theipfield value
-
setPort
Value of theportfield.- Parameters:
port- theportfield value
-
setNumFailures
Value of thenumFailuresfield.- Parameters:
numFailures- thenumFailuresfield value
-
equals
-
hashCode
public int hashCode() -
toString
-