See http://tarkistusmerkit.
See http://tarkistusmerkit.teppovuori.fi/tarkmerk.htm#y-tunnus2 for specs.
Create a T from an input String, returning an scala.util.Either.
Create a T from an input String, returning an scala.util.Either.
See also fromStringUnsafe for cases where you are sure that the input is a valid T (or you are willing to handle exceptions).
Examples:
>>> Pic("070377-281V") Right(070377-281V) >>> Pic("070377-281") Left(Invalid PIC: '070377-281'. PIC should have 11 characters, but was 10 characters.) >>> Pic("070377-2818") Left(Invalid PIC: '070377-2818'. The control character ('8') is wrong: it should be 'V'.)
a valid String representation of T.
Left(String) if the given String is not a valid String representation of T, return a scala.util.Left containing an error message. Right(T) if the given String is a valid String representation of T, return a scala.util.Right containing the T object.
A shorter alias for fromStringUnsafe.
A shorter alias for fromStringUnsafe. See the documentation for that function.
Examples:
>>> Pic.fromStringU("070377-281V") 070377-281V >>> // Pic.fromStringU("foo") would throw an IllegalArgumentException.
Create a T from an input String, throwing an scala.IllegalArgumentException if the input is not a valid String representation of T.
Create a T from an input String, throwing an scala.IllegalArgumentException if the input is not a valid String representation of T.
See also:
Examples:
>>> Pic.fromStringUnsafe("070377-281V") 070377-281V >>> // Pic.fromStringUnsafe("foo") would throw an IllegalArgumentException.
a valid String representation of T.
a T object if the input is a valid String representation of T.
if the input is not a valid String representation of T.