public class InterfaceAddress extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Tests whether this object is equal to another one.
|
InetAddress |
getAddress()
Returns the InetAddress for this address.
|
InetAddress |
getBroadcast()
Returns the subnet-directed broadcast address if this is an IPv4 interface, null otherwise.
|
short |
getNetworkPrefixLength()
Returns the network prefix length in bits.
|
int |
hashCode()
Returns an integer hash code for this object.
|
String |
toString()
Returns a string containing this interface's address, prefix length, and broadcast address.
|
public boolean equals(Object obj)
equals in class Objectobj - the object to be compared.Object.hashCode()public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class ObjectObject.equals(java.lang.Object)public String toString()
"/172.18.103.112/23 [/172.18.103.255]" or
"/0:0:0:0:0:0:0:1%1/128 [null]".public InetAddress getAddress()
public InetAddress getBroadcast()
public short getNetworkPrefixLength()