Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package finnpic

    This package contains the Finnish Personal Identity Code implementation.

    This package contains the Finnish Personal Identity Code implementation. See the specification at https://vrk.fi/en/personal-identity-code1.

    Some terminology:

    • "PIC" refers to the Personal Identity Code as a concept.
    • "Pic" refers to the class Pic.

    See object Pic and its companion class for usage examples.

    Definition Classes
    org
  • Female
  • Gender
  • Male
  • Pic
  • PicGenerator
p

org

finnpic

package finnpic

This package contains the Finnish Personal Identity Code implementation. See the specification at https://vrk.fi/en/personal-identity-code1.

Some terminology:

  • "PIC" refers to the Personal Identity Code as a concept.
  • "Pic" refers to the class Pic.

See object Pic and its companion class for usage examples.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. finnpic
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. sealed trait Gender extends AnyRef

    The gender of the person, deduced from PIC.

    The gender of the person, deduced from PIC. There are only two options present in the PIC, Male or Female - the PIC does not support more genders yet.

  2. class Pic extends AnyRef

    PIC = Personal Identity Code, "henkilotunnus" in Finnish.

    PIC = Personal Identity Code, "henkilotunnus" in Finnish.

    See https://vrk.fi/en/personal-identity-code1 for specs.

    The constructor is private on purpose, so that Pics can only be created via the companion object (the so called "smart constructor" pattern). This prevents instances which are in an illegal state. Every Pic object can thus be treated as a valid Pic.

    See the companion object for how to create instances of Pic.

    Some examples of Pic creation:

    >>> 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'.)
    
    >>> Pic.fromStringUnsafe("070377-281V")
    070377-281V
    
    // Pic.fromStringU is just a shorter alias for Pic.fromStringUnsafe.
    >>> Pic.fromStringU("070377-281V")
    070377-281V
    
    // If you give Pic.fromStringUnsafe (or Pic.fromStringU) an invalid PIC, they throw an IllegalArgumentException.

Value Members

  1. object Female extends Gender with Product with Serializable

    A female person.

  2. object Male extends Gender with Product with Serializable

    A male person.

  3. object Pic

    Contains the factory methods for creating objects of class Pic.

    Contains the factory methods for creating objects of class Pic. Follows the "smart constructor" pattern, familiar from Haskell.

    Some examples of Pic creation:

    >>> 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'.)
    
    >>> Pic.fromStringUnsafe("070377-281V")
    070377-281V
    
    // Pic.fromStringU is just a shorter alias for Pic.fromStringUnsafe.
    >>> Pic.fromStringU("070377-281V")
    070377-281V
    
    // If you give Pic.fromStringUnsafe (or Pic.fromStringU) an invalid PIC, they throw an IllegalArgumentException.
  4. object PicGenerator

Inherited from AnyRef

Inherited from Any

Ungrouped