Package ej.net

Class Network


  • public class Network
    extends Network
    A network.
    • Constructor Detail

      • Network

        public Network​(String networkInterface)
        Instantiates a Network.
        Parameters:
        networkInterface - the network interface name, cannot be null.
    • Method Detail

      • isPresent

        public boolean isPresent()
        Gets the isPresent.
        Returns:
        the isPresent.
      • setPresent

        public void setPresent​(boolean isPresent)
        Sets the isPresent.
        Parameters:
        isPresent - the isPresent to set.
      • getNetworkInterface

        public String getNetworkInterface()
        Gets the network Interface.
        Returns:
        the networkInterface.
      • isAvailable

        public boolean isAvailable()
        Checks whether the network is available.
        Returns:
        the availability.
      • setAvailable

        public void setAvailable​(boolean available)
        Sets whether the network is available.
        Parameters:
        available - the availability.
      • getCapabilities

        public NetworkCapabilities getCapabilities()
        Gets the capabilities.
        Returns:
        the capabilities.
      • setCapabilities

        public void setCapabilities​(NetworkCapabilities capabilities)
        Sets the capabilities.
        Parameters:
        capabilities - the capabilities to set, cannot be null.
      • isInitialised

        public boolean isInitialised()
        Checks whether the network is initialised.
        Returns:
        true if the network is initialised.
      • willChanged

        public boolean willChanged​(boolean available)
        Checks whether the network will change or has not been initialised yet.
        Parameters:
        available - the new state.
        Returns:
        true if the network status change.
      • willChanged

        public boolean willChanged​(NetworkCapabilities capabilities)
        Checks if the Network state will change if set a new capability.
        Parameters:
        capabilities - the new capabilities, cannot be null.
        Returns:
        true if it will change.