com.scalacraft.domain.v2.net
An IP4Address represents an IP4 address.
IP4Address
This class constrains the range of each byte to [0, 255].
Pattern matching is supported as the following example demonstrates,
"192.162.1.9" match { case IP4Address(_, _, b3, b4) => Some(256 * b3 + b4) // Some(265) case _ => None }
Implicit conversions exist which allow an instance of IP4Address when a String is required.
String
val ipa = IP4Address(b1, b2, b3, b4) val inet = java.v2.InetAddress.getByName(ipa)
A conversion to the unconstrained version of this class is also available.
An
IP4Address
represents an IP4 address.This class constrains the range of each byte to [0, 255].
Pattern Matching
Pattern matching is supported as the following example demonstrates,
Implicit Conversions
Implicit conversions exist which allow an instance of
IP4Address
when aString
is required.A conversion to the unconstrained version of this class is also available.