Package ej.net

Class Network


  • public class Network
    extends android.net.Network
    A network.
    • Constructor Summary

      Constructors 
      Constructor Description
      Network​(java.lang.String networkInterface)
      Instantiates a Network.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      android.net.NetworkCapabilities getCapabilities()
      Gets the capabilities.
      java.lang.String getNetworkInterface()
      Gets the network Interface.
      boolean isAvailable()
      Checks whether the network is available.
      boolean isInitialised()
      Checks whether the network is initialised.
      boolean isPresent()
      Gets the isPresent.
      void setAvailable​(boolean available)
      Sets whether the network is available.
      void setCapabilities​(android.net.NetworkCapabilities capabilities)
      Sets the capabilities.
      void setPresent​(boolean isPresent)
      Sets the isPresent.
      boolean willChanged​(boolean available)
      Checks whether the network will change or has not been initialised yet.
      boolean willChanged​(android.net.NetworkCapabilities capabilities)
      Checks if the Network state will change if set a new capability.
      • Methods inherited from class java.lang.Object

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

      • Network

        public Network​(java.lang.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 java.lang.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 android.net.NetworkCapabilities getCapabilities()
        Gets the capabilities.
        Returns:
        the capabilities.
      • setCapabilities

        public void setCapabilities​(android.net.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​(android.net.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.