public static class NetworkRequest.Builder extends Object
NetworkRequest
objects. Specify the Network features needed in terms of
NetworkCapabilities
featuresConstructor and Description |
---|
Builder()
Default constructor for Builder.
|
Modifier and Type | Method and Description |
---|---|
NetworkRequest.Builder |
addCapability(int capability)
The capability to add.
|
NetworkRequest |
build()
Build
NetworkRequest give the current set of capabilities. |
NetworkRequest.Builder |
removeCapability(int capability)
Removes (if found) the given capability from this builder instance.
|
public NetworkRequest.Builder addCapability(int capability)
capability
- The capability to add. Value is NetworkCapabilities.NET_CAPABILITY_INTERNET
public NetworkRequest build()
NetworkRequest
give the current set of capabilities.public NetworkRequest.Builder removeCapability(int capability)
capability
- The capability to remove. Value is NetworkCapabilities.NET_CAPABILITY_INTERNET