Enum NetStat.BusyPort.IPVersion
- java.lang.Object
-
- java.lang.Enum<NetStat.BusyPort.IPVersion>
-
- org.terracotta.utilities.test.net.NetStat.BusyPort.IPVersion
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<NetStat.BusyPort.IPVersion>
- Enclosing class:
- NetStat.BusyPort
public static enum NetStat.BusyPort.IPVersion extends java.lang.Enum<NetStat.BusyPort.IPVersion>
Enumerates the types of IP addresses supported.
-
-
Field Summary
Fields Modifier and Type Field Description private intaddressBytesprivate java.util.List<java.lang.String>versionIds
-
Constructor Summary
Constructors Modifier Constructor Description privateIPVersion(java.lang.Class<? extends java.net.InetAddress> addressClass, int addressBytes, java.lang.String... versionIds)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]anyLocal()Gets the byte-array form of "any local address" for thisIPVersion.static NetStat.BusyPort.IPVersionfromId(java.lang.String versionId)Determines theIPVersionfrom the identifier provided.java.net.InetSocketAddressgetInetSocketAddress(java.lang.String address, java.lang.String port)Gets anInetSocketAddressinstance composed of the IP address and port provided.abstract byte[]loopback()Gets the byte-array form of the "loopback address" for thisIPVersion.abstract java.net.InetAddressunspecified()Returns anInetAddressinstance indicating an "unspecified" (or failed) host address.static NetStat.BusyPort.IPVersionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static NetStat.BusyPort.IPVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IPV4
public static final NetStat.BusyPort.IPVersion IPV4
-
IPV6
public static final NetStat.BusyPort.IPVersion IPV6
-
-
Method Detail
-
values
public static NetStat.BusyPort.IPVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NetStat.BusyPort.IPVersion c : NetStat.BusyPort.IPVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NetStat.BusyPort.IPVersion valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
anyLocal
public byte[] anyLocal()
Gets the byte-array form of "any local address" for thisIPVersion.- Returns:
- a byte array for "any local address"
-
loopback
public abstract byte[] loopback()
Gets the byte-array form of the "loopback address" for thisIPVersion.- Returns:
- a byte array for "loopback address
-
unspecified
public abstract java.net.InetAddress unspecified()
Returns anInetAddressinstance indicating an "unspecified" (or failed) host address.- Returns:
- an "unspecified" address
-
getInetSocketAddress
public java.net.InetSocketAddress getInetSocketAddress(java.lang.String address, java.lang.String port)Gets anInetSocketAddressinstance composed of the IP address and port provided.- Parameters:
address- the IP address conforming tothisIPVersion; a value of*is interpreted as the "any local" addressport- the socket port; a value of*is interpreted as 0 (undesignated)- Returns:
- an
InetSocketAddressinstance foraddressandport; theInetSocketAddressreturned may not be of the type implied bythisIPVersioninstance --lsofdoes not maintain strict type alignment for IP addresses
-
fromId
public static NetStat.BusyPort.IPVersion fromId(java.lang.String versionId)
Determines theIPVersionfrom the identifier provided.- Parameters:
versionId- the identifier to check- Returns:
- the
IPVersioncorresponding toversionId - Throws:
java.lang.EnumConstantNotPresentException- ifversionIdis not a recognizedIPVersiondesignation
-
-