Enum NetStat.BusyPort.IPVersion
java.lang.Object
java.lang.Enum<NetStat.BusyPort.IPVersion>
org.terracotta.utilities.test.net.NetStat.BusyPort.IPVersion
- All Implemented Interfaces:
Serializable,Comparable<NetStat.BusyPort.IPVersion>,java.lang.constant.Constable
- Enclosing class:
- NetStat.BusyPort
Enumerates the types of IP addresses supported.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIPVersion(Class<? extends InetAddress> addressClass, int addressBytes, String... versionIds) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]anyLocal()Gets the byte-array form of "any local address" for thisIPVersion.static NetStat.BusyPort.IPVersionDetermines theIPVersionfrom the identifier provided.getInetSocketAddress(String address, 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 InetAddressReturns anInetAddressinstance indicating an "unspecified" (or failed) host address.static NetStat.BusyPort.IPVersionReturns 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 Details
-
IPV4
-
IPV6
-
-
Field Details
-
addressBytes
private final int addressBytes -
versionIds
-
-
Constructor Details
-
IPVersion
private IPVersion(Class<? extends InetAddress> addressClass, int addressBytes, String... versionIds)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- 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
Returns anInetAddressinstance indicating an "unspecified" (or failed) host address.- Returns:
- an "unspecified" address
-
getInetSocketAddress
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
Determines theIPVersionfrom the identifier provided.- Parameters:
versionId- the identifier to check- Returns:
- the
IPVersioncorresponding toversionId - Throws:
EnumConstantNotPresentException- ifversionIdis not a recognizedIPVersiondesignation
-