class IpNetwork
source · line 9public
public class IpNetwork public constructor(
address: IpAddress,
/**
* The number of leading address bits belonging to the network prefix.
*/
public val prefixLength: Int
) : Equals<IpNetwork>, Hash, ToString
- Supertype
Equals<IpNetwork> - Supertype
Hash - Supertype
ToString
An IP prefix whose stored network address has host bits cleared. Membership requires a compatible address family and matching prefix.
property family
source · line 23public
public val family: AddressFamily
get: public read-only
The network's address family.
getter get
source · line 23public
get(): AddressFamily
constructor constructor
source · line 9public
constructor(address: IpAddress, public val prefixLength: Int)
parameter prefixLength
source · line 14public
public val prefixLength: Int
parameter address
source · line 10public
address: IpAddress
function toString
source · line 54public
public override fun toString(): String
- Overrides
toString
Returns numeric address notation without performing name resolution.
function equals
source · line 45public
public override operator fun equals(other: IpNetwork): Boolean
- Overrides
equals
Compares the complete normalized address identity, including its relevant family, scope, prefix, or port.
parameter other
source · line 45public
other: IpNetwork
property prefixLength
source · line 14public
public val prefixLength: Int
get: public read-only
The number of leading address bits belonging to the network prefix.
function contains
source · line 28public
public fun contains(candidate: IpAddress): Boolean
Tests whether a compatible candidate shares this network prefix.
parameter candidate
source · line 28public
candidate: IpAddress
property address
source · line 19public
public val address: IpAddress
get: public read-only
The normalized network address with host bits cleared.
function hash
source · line 50public
public override fun hash(): Long
- Overrides
hash
Hashes the same address identity used by equality.