RouteInfo
class RouteInfo : Parcelable
| kotlin.Any | |
| ↳ | android.net.RouteInfo |
Represents a network route.
This is used both to describe static network configuration and live network configuration information. A route contains three pieces of information:
- a destination
IpPrefixspecifying the network destinations covered by this route. If this isnullit indicates a default route of the address family (IPv4 or IPv6) implied by the gateway IP address. - a gateway
InetAddressindicating the next hop to use. If this isnullit indicates a directly-connected route. - an interface (which may be unspecified).
null, but not both. If the destination and gateway are both specified, they must be of the same address family (IPv4 or IPv6).
Summary
Inherited constants |
|
|---|---|
Public methods |
|
|---|---|
| Int |
Implement the Parcelable interface |
| Boolean |
Compares this RouteInfo object against the specified object and indicates if they are equal. |
| IpPrefix |
Retrieves the destination address and prefix length in the form of an |
| InetAddress? |
Retrieves the gateway or next hop |
| String? |
Retrieves the interface used for this route if specified, else |
| Boolean |
Indicates if this route has a next hop ( |
| Int |
hashCode()Returns a hashcode for this |
| Boolean |
Indicates if this route is a default route (ie, has no destination specified). |
| Boolean |
matches(destination: InetAddress!)Determines whether the destination and prefix of this route includes the specified address. |
| String |
toString()Returns a human-readable description of this object. |
| Unit |
writeToParcel(dest: Parcel!, flags: Int)Implement the Parcelable interface |
Properties |
|
|---|---|
| static Parcelable.Creator<RouteInfo!> |
Implement the Parcelable interface. |
Public methods
describeContents
fun describeContents(): Int
Implement the Parcelable interface
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Compares this RouteInfo object against the specified object and indicates if they are equal.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if the objects are equal, false otherwise. |
getDestination
fun getDestination(): IpPrefix
Retrieves the destination address and prefix length in the form of an IpPrefix.
| Return | |
|---|---|
IpPrefix |
IpPrefix specifying the destination. This is never null. |
getGateway
fun getGateway(): InetAddress?
Retrieves the gateway or next hop InetAddress for this route.
| Return | |
|---|---|
InetAddress? |
InetAddress specifying the gateway or next hop. This may be null for a directly-connected route." |
getInterface
fun getInterface(): String?
Retrieves the interface used for this route if specified, else null.
| Return | |
|---|---|
String? |
The name of the interface used for this route. |
hasGateway
fun hasGateway(): Boolean
Indicates if this route has a next hop (true) or is directly-connected (false).
| Return | |
|---|---|
Boolean |
true if a gateway is specified |
hashCode
fun hashCode(): Int
Returns a hashcode for this RouteInfo object.
| Return | |
|---|---|
Int |
a hash code value for this object. |
isDefaultRoute
fun isDefaultRoute(): Boolean
Indicates if this route is a default route (ie, has no destination specified).
| Return | |
|---|---|
Boolean |
true if the destination has a prefix length of 0. |
matches
fun matches(destination: InetAddress!): Boolean
Determines whether the destination and prefix of this route includes the specified address.
| Parameters | |
|---|---|
destination |
InetAddress!: A InetAddress to test to see if it would match this route. |
| Return | |
|---|---|
Boolean |
true if the destination and prefix length cover the given address. |
toString
fun toString(): String
Returns a human-readable description of this object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel!,
flags: Int
): Unit
Implement the Parcelable interface
| Parameters | |
|---|---|
dest |
Parcel!: The Parcel in which the object should be written. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<RouteInfo!>
Implement the Parcelable interface.