com.scalacraft.domain.v2.net.unconstrained
An IP4Address represents an IP4 address.
IP4Address
This class does not constrain the value of the address components.
Pattern matching is supported as the following example demonstrates,
"192.162.0.9" match { case IP4Address(b1, b2, _, _) => Some(b1, b2) // Some(192, 162) 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 an option of the constrained version of this class is also available.
An
IP4Addressrepresents an IP4 address.This class does not constrain the value of the address components.
Pattern Matching
Pattern matching is supported as the following example demonstrates,
Implicit Conversions
Implicit conversions exist which allow an instance of
IP4Addresswhen aStringis required.A conversion to an option of the constrained version of this class is also available.