package org.synyx.urlaubsverwaltung.core.settings;

import java.util.Arrays;


/**
 * Enum representing the federal states of Germany. The information about the federal state is needed to check if a day
 * is a public holiday. This is the reason why the enum contains multiple entries for Bayern (there are areas with
 * different public holidays).
 *
 * @author  Aljona Murygina - murygina@synyx.de
 */
public enum FederalState {

    BADEN_WUERTTEMBERG("bw"),
    BAYERN("by"),
    BAYERN_MUENCHEN("by", "mu"),
    BAYERN_AUGSBURG("by", "ag"),
    BAYERN_WUERZBURG("by", "wu"),
    BAYERN_REGENSBURG("by", "re"),
    BAYERN_INGOLSTADT("by", "in"),
    BERLIN,
    BRANDENBURG("bb"),
    BREMEN,
    HAMBURG,
    HESSEN("he"),
    MECKLENBURG_VORPOMMERN("mv"),
    NIEDERSACHSEN,
    NORDRHEIN_WESTFALEN("nw"),
    RHEINLAND_PFALZ("rp"),
    SAARLAND("sl"),
    SACHSEN("sn"),
    SACHSEN_ANHALT("st"),
    SCHLESWIG_HOLSTEIN,
    THUERINGEN("th");

    private String[] codes;

    FederalState(String... codes) {

        this.codes = codes;
    }

    public String[] getCodes() {

        if (codes == null) {
            return new String[0];
        }

        return Arrays.copyOf(codes, codes.length);
    }
}

@@ -653,18 +653,23 @@
   BERLIN
+(%22b%22)
 ,%0A
-
     BRAN
@@ -693,16 +693,22 @@
   BREMEN
+(%22hb%22)
 ,%0A    HA
@@ -712,16 +712,22 @@
  HAMBURG
+(%22hh%22)
 ,%0A    HE
@@ -789,16 +789,22 @@
 RSACHSEN
+(%22ni%22)
 ,%0A    NO
@@ -916,24 +916,24 @@
 HALT(%22st%22),%0A
-
     SCHLESWI
@@ -942,16 +942,22 @@
 HOLSTEIN
+(%22sh%22)
 ,%0A    TH

add missing federalstate mappingings