com.scalacraft.domain.v2.country.unconstrained
A CountryCodeA3 represents an ISO 3166 alpha-3 country code.
CountryCodeA3
This class does not constrain the value of the code in anyway.
Details of the ISO 3166-1 alpha 3 codes can be found here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
Pattern matching is supported as illustrated by the following examples,
"GBR" match { case CountryCodeA3(code) => code // "GBR" case _ => None }
Invalid country codes will be matched.
"GBRT" match { case CountryCodeA3(code) => code // "GBRT" case _ => None }
An implicit conversion is provided which allows an instance of CountryCodeA3 to be used when a String is required.
String
def logCode(code: String) = println(s"code: $code") val cc = CountryCodeA3("TVU") logCode(cc) // "code: TVU"
An implicit conversion to the constrained version of this class is also available.
A value which can be a valid or invalid alpha 3 country code
A
CountryCodeA3
represents an ISO 3166 alpha-3 country code.This class does not constrain the value of the code in anyway.
Details of the ISO 3166-1 alpha 3 codes can be found here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
Pattern Matching
Pattern matching is supported as illustrated by the following examples,
Invalid country codes will be matched.
Implicit Conversions
An implicit conversion is provided which allows an instance of
CountryCodeA3
to be used when aString
is required.An implicit conversion to the constrained version of this class is also available.
A value which can be a valid or invalid alpha 3 country code