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

public static enum NetStat.BusyPort.IPVersion extends Enum<NetStat.BusyPort.IPVersion>
Enumerates the types of IP addresses supported.
  • Enum Constant Details

  • Field Details

    • addressBytes

      private final int addressBytes
    • versionIds

      private final List<String> versionIds
  • Constructor Details

    • IPVersion

      private IPVersion(Class<? extends InetAddress> addressClass, int addressBytes, String... versionIds)
  • Method Details

    • values

      public static NetStat.BusyPort.IPVersion[] 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

      public static NetStat.BusyPort.IPVersion valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • anyLocal

      public byte[] anyLocal()
      Gets the byte-array form of "any local address" for this IPVersion.
      Returns:
      a byte array for "any local address"
    • loopback

      public abstract byte[] loopback()
      Gets the byte-array form of the "loopback address" for this IPVersion.
      Returns:
      a byte array for "loopback address
    • unspecified

      public abstract InetAddress unspecified()
      Returns an InetAddress instance indicating an "unspecified" (or failed) host address.
      Returns:
      an "unspecified" address
    • getInetSocketAddress

      public InetSocketAddress getInetSocketAddress(String address, String port)
      Gets an InetSocketAddress instance composed of the IP address and port provided.
      Parameters:
      address - the IP address conforming to this IPVersion; a value of * is interpreted as the "any local" address
      port - the socket port; a value of * is interpreted as 0 (undesignated)
      Returns:
      an InetSocketAddress instance for address and port; the InetSocketAddress returned may not be of the type implied by this IPVersion instance -- lsof does not maintain strict type alignment for IP addresses
    • fromId

      public static NetStat.BusyPort.IPVersion fromId(String versionId)
      Determines the IPVersion from the identifier provided.
      Parameters:
      versionId - the identifier to check
      Returns:
      the IPVersion corresponding to versionId
      Throws:
      EnumConstantNotPresentException - if versionId is not a recognized IPVersion designation