Class Networks

java.lang.Object
oshi.hardware.common.Networks
Direct Known Subclasses:
FreeBsdNetworks, LinuxNetworks, MacNetworks, SolarisNetworks, WindowsNetworks

@ThreadSafe
public class Networks
extends java.lang.Object
Network interfaces implementation.
  • Constructor Summary

    Constructors 
    Constructor Description
    Networks()  
  • Method Summary

    Modifier and Type Method Description
    protected java.net.NetworkInterface[] getNetworkInterfaces()
    Returns network interfaces that are not Loopback, and have a hardware address.
    NetworkIF[] getNetworks()
    Gets the network interfaces on this machine

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getNetworks

      public NetworkIF[] getNetworks()
      Gets the network interfaces on this machine
      Returns:
      An array of NetworkIF objects representing the interfaces
    • getNetworkInterfaces

      protected java.net.NetworkInterface[] getNetworkInterfaces()
      Returns network interfaces that are not Loopback, and have a hardware address.
      Returns:
      An array of network interfaces