com.scalacraft.domain.v2.net.unconstrained
A Port represents an IP port.
Port
This class does not constrain the value of the port in anyway.
Pattern matching is supported as the following examples demonstrate,
7 match { case Port(p) => p // 7 case _ => None }
The match target can be a string,
val s: String = ... s match { case Port(p) => p case _ => None }
Implicit conversions exists which allow an instance of Port to be used when an Int or String is required.
Int
String
val port = Port(6006) val isa = new InetSocketAddress(p)
A conversion to an option of the constrained version of this class is also available.
A
Port
represents an IP port.This class does not constrain the value of the port in anyway.
Pattern Matching
Pattern matching is supported as the following examples demonstrate,
The match target can be a string,
Implicit Conversions
Implicit conversions exists which allow an instance of
Port
to be used when anInt
orString
is required.A conversion to an option of the constrained version of this class is also available.