Ipv6Address

com.comcast.ip4s.Ipv6Address
See theIpv6Address companion object
final class Ipv6Address extends IpAddress

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

Attributes

Companion:
object
Source:
Host.scala
Graph
Supertypes
class IpAddress
trait Host
trait Ordered[Host]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

override def fold[A](v4: Ipv4Address => A, v6: Ipv6Address => A): A

Converts this address to a value of type A using the supplied functions.

Converts this address to a value of type A using the supplied functions.

Attributes

Definition Classes
Source:
Host.scala
override def isMulticast: Boolean

Returns true if this address is in the multicast range.

Returns true if this address is in the multicast range.

Attributes

Definition Classes
Source:
Host.scala

Returns true if this address is in the source specific multicast range.

Returns true if this address is in the source specific multicast range.

Attributes

Definition Classes
Source:
Host.scala

Applies the supplied mask to this address.

Applies the supplied mask to this address.

Attributes

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

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.

Attributes

Example:
scala> ipv6"ff3b::1".maskedLast(ipv6"fff0::")
res0: Ipv6Address = ff3f:ffff:ffff:ffff:ffff:ffff:ffff:ffff
Source:
Host.scala
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 ::.

Attributes

Definition Classes
Source:
Host.scala
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.

Attributes

Definition Classes
Source:
Host.scala

Converts this address to a 128-bit unsigned integer.

Converts this address to a 128-bit unsigned integer.

Attributes

Source:
Host.scala

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.

Attributes

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
Source:
Host.scala
override def toString: String

Returns the condensed string representation of the array per RFC5952.

Returns the condensed string representation of the array per RFC5952.

Attributes

Definition Classes
Any
Source:
Host.scala

Returns an uncondensed string representation of the array.

Returns an uncondensed string representation of the array.

Attributes

Source:
Host.scala
override def toUriString: String

Converts this address to a string form that is compatible for use in a URI per RFC3986 (namely, IPv6 addresses are rendered in condensed form and surrounded by brackets).

Converts this address to a string form that is compatible for use in a URI per RFC3986 (namely, IPv6 addresses are rendered in condensed form and surrounded by brackets).

Attributes

Definition Classes
Source:
Host.scala
override def transform(v4: Ipv4Address => Ipv4Address, v6: Ipv6Address => Ipv6Address): Ipv6Address.this.type

Maps a type-preserving function across this IP address.

Maps a type-preserving function across this IP address.

Attributes

Definition Classes
Source:
Host.scala

Inherited methods

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

Constructs a Cidr address from this address.

Constructs a Cidr address from this address.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

Attributes

Inherited from:
Ordered

Attributes

Inherited from:
Ordered

Attributes

Inherited from:
Ordered

Attributes

Inherited from:
Ordered

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

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

Attributes

Inherited from:
IpAddress
Source:
Host.scala

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

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

Attributes

Inherited from:
IpAddress
Source:
Host.scala

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.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

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.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

Like asSourceSpecificMulticast but allows multicast addresses outside the source specific range.

Like asSourceSpecificMulticast but allows multicast addresses outside the source specific range.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

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.

Attributes

Inherited from:
IpAddress
Source:
Host.scala
def compare(that: Host): Int

Attributes

Inherited from:
Host
Source:
Host.scala

Attributes

Inherited from:
Ordered
override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Attributes

that

the object to compare against this object for equality.

Returns:

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
IpAddress -> Any
Inherited from:
IpAddress
Source:
Host.scala
override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns:

the hash code value for this object.

Definition Classes
IpAddress -> Any
Inherited from:
IpAddress
Source:
Host.scala

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.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

Returns the number of leading ones in this address. When this address is a netmask, the result can be used to create a CIDR.

Returns the number of leading ones in this address. When this address is a netmask, the result can be used to create a CIDR.

Attributes

Example:
scala> val address = ipv4"192.168.1.25"
scala> val netmask = ipv4"255.255.0.0"
scala> (address / netmask.prefixBits): Cidr[Ipv4Address]
res0: Cidr[Ipv4Address] = 192.168.1.25/16
Inherited from:
IpAddress
Source:
Host.scala
def resolve[F[_] : Applicative]: F[IpAddress]

Resolves this host to an ip address using the platform DNS resolver.

Resolves this host to an ip address using the platform DNS resolver.

If the host cannot be resolved, the effect fails with a com.comcast.ip4s.UnknownHostException.

Attributes

Inherited from:
Host
Source:
Host.scala

Resolves this host to all ip addresses known to the platform DNS resolver.

Resolves this host to all ip addresses known to the platform DNS resolver.

If the host cannot be resolved, an empty list is returned.

Attributes

Inherited from:
Host
Source:
Host.scala

Resolves this host to an ip address using the platform DNS resolver.

Resolves this host to an ip address using the platform DNS resolver.

If the host cannot be resolved, a None is returned.

Attributes

Inherited from:
Host
Source:
Host.scala

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.

Attributes

Inherited from:
IpAddress
Source:
Host.scala

Returns the version of this address.

Returns the version of this address.

Attributes

Inherited from:
IpAddress
Source:
Host.scala