Package ej.net
Class Network
- java.lang.Object
-
- android.net.Network
-
- ej.net.Network
-
public class Network extends android.net.NetworkA network.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.net.NetworkCapabilitiesgetCapabilities()Gets the capabilities.java.lang.StringgetNetworkInterface()Gets the network Interface.booleanisAvailable()Checks whether the network is available.booleanisInitialised()Checks whether the network is initialised.booleanisPresent()Gets the isPresent.voidsetAvailable(boolean available)Sets whether the network is available.voidsetCapabilities(android.net.NetworkCapabilities capabilities)Sets the capabilities.voidsetPresent(boolean isPresent)Sets the isPresent.booleanwillChanged(boolean available)Checks whether the network will change or has not been initialised yet.booleanwillChanged(android.net.NetworkCapabilities capabilities)Checks if the Network state will change if set a new capability.
-
-
-
Constructor Detail
-
Network
public Network(java.lang.String networkInterface)
Instantiates aNetwork.- Parameters:
networkInterface- the network interface name, cannot benull.
-
-
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 benull.
-
isInitialised
public boolean isInitialised()
Checks whether the network is initialised.- Returns:
trueif 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:
trueif 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 benull.- Returns:
trueif it will change.
-
-