Ipv4Address

final class Ipv4Address extends IpAddress with Ipv4AddressPlatform
Representation of an IPv4 address that works on both the JVM and Scala.js.
Companion
object
trait Ipv4AddressPlatform
class IpAddress
trait Serializable
trait Host
trait Ordered[Host]
trait Comparable[Host]
trait HostPlatform
trait IpAddressPlatform
class Object
trait Matchable
class Any

Value members

Methods

override def fold[A](v4: Ipv4Address => A, v6: Ipv6Address => A): A
Definition Classes
Definition Classes
override def toString: String
Returns the dotted decimal representation of this address.
Definition Classes
Any
override def toUriString: String
Definition Classes
def toLong: Long
Converts this address to a 32-bit unsigned integer.
override def isMulticast: Boolean
Definition Classes
override def isSourceSpecificMulticast: Boolean
Definition Classes
Converts this V4 address to a compat V6 address, where the first 12 bytes are all zero
and the last 4 bytes contain the bytes of this V4 address.
Converts this V4 address to a mapped V6 address, where the first 10 bytes are all zero,
the next two bytes are ff, and the last 4 bytes contain the bytes of this V4 address.
Applies the supplied mask to this address.
Example
{{{
scala> ipv4"192.168.29.1".masked(ipv4"255.255.0.0")
res0: Ipv4Address = 192.168.0.0
}}}
Computes the last address in the network identified by applying the supplied mask to this address.
Example
{{{
scala> ipv4"192.168.29.1".maskedLast(ipv4"255.255.0.0")
res0: Ipv4Address = 192.168.255.255
}}}

Inherited methods

Returns the version of this address.
Inhertied from
IpAddress
def >(that: A): Boolean
Inhertied from
Ordered
override def toInetAddress: Inet4Address
Definition Classes
Ipv4AddressPlatform -> IpAddressPlatform
Inhertied from
Ipv4AddressPlatform
def toBytes: Array[Byte]
Converts this address to a network order byte array of either 4 or 16 bytes.
Inhertied from
IpAddress
def <(that: A): Boolean
Inhertied from
Ordered
def compareTo(that: A): Int
Inhertied from
Ordered
Converts this address to a source specific multicast address, as long as it is in the source specific multicast address range.
Inhertied from
IpAddress
def asIpv6: Option[Ipv6Address]
Narrows this address to an Ipv6Address if that is the underlying type.
Inhertied from
IpAddress
def <=(that: A): Boolean
Inhertied from
Ordered
def resolveOption[F <: ([_$2] =>> Any)](evidence$3: Dns[F], evidence$4: ApplicativeThrow[F]): F[Option[IpAddress]]
Resolves this host to an ip address using the platform DNS resolver.
If the host cannot be resolved, a None is returned.
Inhertied from
HostPlatform
Converts this address to a multicast address, as long as it is in the multicast address range.
Inhertied from
IpAddress
def /(prefixBits: Int): Cidr[IpAddress]
Constructs a Cidr address from this address.
Inhertied from
IpAddress
def resolveAll[F <: ([_$4] =>> Any)](evidence$5: Dns[F], evidence$6: Applicative[F]): F[List[IpAddress]]
Resolves this host to all ip addresses known to the platform DNS resolver.
If the host cannot be resolved, an empty list is returned.
Inhertied from
HostPlatform
def asIpv4: Option[Ipv4Address]
Narrows this address to an Ipv4Address if that is the underlying type.
Inhertied from
IpAddress
override def hashCode: Int
Definition Classes
IpAddress -> Any
Inhertied from
IpAddress
def >=(that: A): Boolean
Inhertied from
Ordered
def compare(that: Host): Int
Inhertied from
Host
def resolve[F <: ([_$1] =>> Any)](evidence$1: Dns[F], evidence$2: Applicative[F]): F[IpAddress]
Resolves this host to an ip address using the platform DNS resolver.
If the host cannot be resolved, the effect fails with a java.net.UnknownHostException.
Inhertied from
HostPlatform
override def equals(other: Any): Boolean
Definition Classes
IpAddress -> Any
Inhertied from
IpAddress