Code example for NetworkInterface

Methods: getName

0
    public static boolean sameNetworkInterface(final NetworkInterface netIf1, final NetworkInterface netIf2) {
        if (netIf1 == null || netIf2 == null) {
            return false; 
        } 
 
        return netIf1.getName().equals(netIf2.getName());
    } 
 
    /** 
     * Iterates through a list of available network interfaces, and returns 
     * the first that is usable. Returns <code>null</code> if no usable 
     * interface is found. 
     * 
     * @return The first usable network interface, or <code>null</code>. 
     * @see #isUsable(NetworkInterface) 
     */ 
    public static NetworkInterface findFirstUsableNetworkInterface() {
        final Enumeration<NetworkInterface> networkInterfaces = getNetworkInterfaces();
 
        if (networkInterfaces == null) {
Contextual code suggestions in your IDE  Get Codota for Java