public class Network
extends android.net.Network
Constructor and Description |
---|
Network(java.lang.String networkInterface)
Instantiates a
Network . |
Modifier and Type | Method and 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.
|
public Network(java.lang.String networkInterface)
Network
.networkInterface
- the network interface name, cannot be null
.public boolean isPresent()
public void setPresent(boolean isPresent)
isPresent
- the isPresent to set.public java.lang.String getNetworkInterface()
public boolean isAvailable()
public void setAvailable(boolean available)
available
- the availability.public android.net.NetworkCapabilities getCapabilities()
public void setCapabilities(android.net.NetworkCapabilities capabilities)
capabilities
- the capabilities to set, cannot be null
.public boolean isInitialised()
true
if the network is initialised.public boolean willChanged(boolean available)
available
- the new state.true
if the network status change.public boolean willChanged(android.net.NetworkCapabilities capabilities)
capabilities
- the new capabilities, cannot be null
.true
if it will change.