Class NetworkInterfaceUtil

java.lang.Object
org.somda.sdc.dpws.network.NetworkInterfaceUtil

public class NetworkInterfaceUtil extends Object
Utility class for network interface related functionality.
  • Constructor Details

    • NetworkInterfaceUtil

      public NetworkInterfaceUtil()
  • Method Details

    • getFirstIpV4Address

      public Optional<InetAddress> getFirstIpV4Address(NetworkInterface networkInterface)
      Loops through a network interface's addresses and returns the first one that matches an IPv4 address.
      Parameters:
      networkInterface - the network interface where to seek for an IPv4 address.
      Returns:
      the first found IPv4 address or empty if there is no IPv4 address connected to the network interface.