Package ej.net
Class Network
- java.lang.Object
-
- android.net.Network
-
- ej.net.Network
-
public class Network extends Network
A network.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkCapabilitiesgetCapabilities()Gets the capabilities.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(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(NetworkCapabilities capabilities)Checks if the Network state will change if set a new capability.
-
-
-
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 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(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.
-
-