Package org.stellar.sdk.xdr
Class PeerAddress.PeerAddressIp
java.lang.Object
org.stellar.sdk.xdr.PeerAddress.PeerAddressIp
- All Implemented Interfaces:
XdrElement
- Enclosing class:
PeerAddress
PeerAddressIp's original definition in the XDR file is:
union switch (IPAddrType type)
{
case IPv4:
opaque ipv4[4];
case IPv6:
opaque ipv6[16];
}
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionPeerAddressIp(IPAddrType discriminant, byte[] ipv4, byte[] ipv6) Creates a newPeerAddressIpinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static PeerAddress.PeerAddressIpdecode(XdrDataInputStream stream) static PeerAddress.PeerAddressIpdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic PeerAddress.PeerAddressIpstatic PeerAddress.PeerAddressIpfromXdrBase64(String xdr) static PeerAddress.PeerAddressIpfromXdrByteArray(byte[] xdr) Value of thediscriminantfield.byte[]getIpv4()Value of theipv4field.byte[]getIpv6()Value of theipv6field.inthashCode()voidsetDiscriminant(IPAddrType discriminant) Value of thediscriminantfield.voidsetIpv4(byte[] ipv4) Value of theipv4field.voidsetIpv6(byte[] ipv6) Value of theipv6field.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
PeerAddressIp
public PeerAddressIp() -
PeerAddressIp
Creates a newPeerAddressIpinstance.- Parameters:
discriminant- thediscriminantfield valueipv4- theipv4field valueipv6- theipv6field 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
public static PeerAddress.PeerAddressIp decode(XdrDataInputStream stream, int maxDepth) throws IOException - 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
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getIpv4
public byte[] getIpv4()Value of theipv4field.- Returns:
- the
ipv4field value
-
getIpv6
public byte[] getIpv6()Value of theipv6field.- Returns:
- the
ipv6field value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setIpv4
public void setIpv4(byte[] ipv4) Value of theipv4field.- Parameters:
ipv4- theipv4field value
-
setIpv6
public void setIpv6(byte[] ipv6) Value of theipv6field.- Parameters:
ipv6- theipv6field value
-
equals
-
hashCode
public int hashCode() -
toString
-