Ipv6Address

final class Ipv6Address extends IpAddress with Ipv6AddressPlatform

Representation of an IPv6 address that works on both the JVM and Scala.js.

Companion
object
trait Ipv6AddressPlatform
class IpAddress
trait Serializable
trait Host
trait Ordered[Host]
trait Comparable[Host]
trait HostPlatform
trait IpAddressPlatform
class Object
trait Matchable
class Any

Value members

Concrete methods

override def fold[A](v4: Ipv4Address => A, v6: Ipv6Address => A): A
Definition Classes
override def isMulticast: Boolean
Definition Classes
override def isSourceSpecificMulticast: Boolean
Definition Classes

Applies the supplied mask to this address.

Applies the supplied mask to this address.

Example
scala> ipv6"ff3b::1".masked(ipv6"fff0::") res0: Ipv6Address = ff30::

Computes the last address in the network identified by applying the supplied mask to this address.

Computes the last address in the network identified by applying the supplied mask to this address.

Example
 scala> ipv6"ff3b::1".maskedLast(ipv6"fff0::") res0: Ipv6Address = ff3f:ffff:ffff:ffff:ffff:ffff:ffff:ffff
override def next: Ipv6Address

Gets the IPv6 address after this address, with overflow from ffff:ffff:....:ffff to ::.

Gets the IPv6 address after this address, with overflow from ffff:ffff:....:ffff to ::.

Definition Classes
override def previous: Ipv6Address

Gets the IPv6 address before this address, with underflow from :: to ffff:ffff:....:ffff.

Gets the IPv6 address before this address, with underflow from :: to ffff:ffff:....:ffff.

Definition Classes
def toBigInt: BigInt

Converts this address to a 128-bit unsigned integer.

Converts this address to a 128-bit unsigned integer.

def toMixedString: String

Converts this address to a string of form x:x:x:x:x:x:a.b.c.d where each x represents 16-bits and a.b.c.d is IPv4 dotted decimal notation. Consecutive 0 x fields are condensed with ::.

Converts this address to a string of form x:x:x:x:x:x:a.b.c.d where each x represents 16-bits and a.b.c.d is IPv4 dotted decimal notation. Consecutive 0 x fields are condensed with ::.

For example, the IPv4 address 127.0.0.1 can be converted to a compatible IPv6 address via Ipv4Address#toCompatV6, which is represented as the string ::7f00:1 and the mixed string ::127.0.0.1.

Similarly, 127.0.0.1 can be converted to a mapped V6 address via Ipv4Address#toMappedV6, resulting in ::ffff:7f00:1 and the mixed string ::ffff:127.0.0.1.

This format is described in RFC4291 section 2.2.3.

Example
 scala> ipv6"::7f00:1".toMixedString res0: String = ::127.0.0.1 scala>
 ipv6"ff3b:1234::ffab:7f00:1".toMixedString res0: String = ff3b:1234::ffab:127.0.0.1 
override def toString: String

Returns the condensed string representation of the array per RFC5952.

Returns the condensed string representation of the array per RFC5952.

Definition Classes
Any
def toUncondensedString: String

Returns an uncondensed string representation of the array.

Returns an uncondensed string representation of the array.

override def toUriString: String
Definition Classes
Definition Classes

Inherited methods

def /(prefixBits: Int): Cidr[Ipv6Address]

Constructs a Cidr address from this address.

Constructs a Cidr address from this address.

Inherited from
IpAddress
def <(that: Host): Boolean
Inherited from
Ordered
def <=(that: Host): Boolean
Inherited from
Ordered
def >(that: Host): Boolean
Inherited from
Ordered
def >=(that: Host): Boolean
Inherited from
Ordered
def asIpv4: Option[Ipv4Address]

Narrows this address to an Ipv4Address if that is the underlying type.

Narrows this address to an Ipv4Address if that is the underlying type.

Inherited from
IpAddress
def asIpv6: Option[Ipv6Address]

Narrows this address to an Ipv6Address if that is the underlying type.

Narrows this address to an Ipv6Address if that is the underlying type.

Inherited from
IpAddress

Converts this address to a multicast address, as long as it is in the multicast address range.

Converts this address to a multicast address, as long as it is in the multicast address range.

Inherited from
IpAddress

Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.

Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.

Inherited from
IpAddress

If this address is an IPv4 mapped IPv6 address, converts to an IPv4 address, otherwise returns this.

If this address is an IPv4 mapped IPv6 address, converts to an IPv4 address, otherwise returns this.

Inherited from
IpAddress
def compare(that: Host): Int
Inherited from
Host
def compareTo(that: Host): Int
Inherited from
Ordered
override def equals(other: Any): Boolean
Definition Classes
IpAddress -> Any
Inherited from
IpAddress
override def hashCode: Int
Definition Classes
IpAddress -> Any
Inherited from
IpAddress
def isMappedV4: Boolean

Returns true if this address is a V6 address containing a mapped V4 address.

Returns true if this address is a V6 address containing a mapped V4 address.

Inherited from
IpAddress
def toBytes: Array[Byte]

Converts this address to a network order byte array of either 4 or 16 bytes.

Converts this address to a network order byte array of either 4 or 16 bytes.

Inherited from
IpAddress

Returns the version of this address.

Returns the version of this address.

Inherited from
IpAddress