/**
 * Copyright © CENRA (2016)
 *
 * remi.clement@espaces-naturels.fr
 * 
 * This software is a multi-platform and portable application based on 
 * the scientifical toolbox to monitor wetlands. With this toolbox it’s 
 * possible to calculate indicators «RhoMéO» to monitor quality, 
 * fonctionalities and urban and agricultural pressures of wetlands. 
 * Indicators are calculated using naturalist data entered and/or imported,
 * and geographic data downloaded from a geographic server.
 * 
 * This software is governed by the CeCILL license under French law and
 * abiding by the rules of distribution of free software.  You can  use, 
 * modify and/ or redistribute the software under the terms of the CeCILL
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * "http://www.cecill.info". 
 * 
 * As a counterpart to the access to the source code and  rights to copy,
 * modify and redistribute granted by the license, users are provided only
 * with a limited warranty  and the software's author,  the holder of the
 * economic rights,  and the successive licensors  have only  limited
 * liability. 
 * 
 * In this respect, the user's attention is drawn to the risks associated
 * with loading,  using,  modifying and/or developing or reproducing the
 * software by the user in light of its specific status of free software,
 * that may mean  that it is complicated to manipulate,  and  that  also
 * therefore means  that it is reserved for developers  and  experienced
 * professionals having in-depth computer knowledge. Users are therefore
 * encouraged to load and test the software's suitability as regards their
 * requirements in conditions enabling the security of their systems and/or 
 * data to be ensured and,  more generally, to use and operate it in the 
 * same conditions as regards security. 
 * 
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL license and that you accept its terms.
*/
package fr.cenra.rhomeo.core.list;

/**
 * @author Cédric Briançon (Geomatys)
 */
public enum HumidZoneType implements CodeValue {

    GRANDS_ESTUAIRES             ("1",     "Grands estuaires"), // Indicateurs : 1, 2, 3, 5, 6, 8, 12, 13
    BAIES_ESTUAIRES              ("2",     "Baies et estuaires moyens plats"), // Indicateurs : 1, 2, 3, 5, 6, 8, 12, 13
    MARAIS_LAGUNES               ("3.1",   "Marais et lagunes côtiers - lagunes"), // Indicateurs : 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13
    MARAIS_LAGUNES_PERI_LAGUN    ("3.2",   "Marais et lagunes côtiers - péri-lagunaire"), // Indicateurs : 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13
    MARAIS_LAGUNES_PERI_LAGUN_EAU("3.3",   "Marais et lagunes côtiers - péri-lagunaire avec rapport d'eau"), // Indicateurs : 1, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13
    MARAIS_SAUMATRES             ("4",     "Marais saumâtres aménagés"), // Indicateurs : 1, 2, 3, 6, 8, 9, 10, 11, 12, 13
    BORDURES_COURS_EAU           ("5",     "Bordures de cours d'eau"), // Indicateurs : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
    PLAINES_ALLUVIALES           ("6",     "Plaines alluviales"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_BAS_FOND_ALTITUDE         ("7.1",   "Zones humides de bas-fonds en tête de BV - altitude"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13
    ZH_BAS_FOND_TOURB_ACIDE      ("7.2",   "Zones humides de bas-fonds en tête de BV - tourbière acide"), // Indicateurs : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_BAS_FOND_TOURB_ALCALINE   ("7.3",   "Zones humides de bas-fonds en tête de BV - tourbière alcaline"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_BAS_FOND_PENTES           ("7.4",   "Zones humides de bas-fonds en tête de BV - pentes et sources"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_BAS_FOND_COMBES           ("7.5",   "Zones humides de bas-fonds en tête de BV - combes et bordure de ruisseau"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    REGIONS_ETANGS               ("8",     "Régions d'étangs"), // Indicateurs : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
    BORDURES_PLAN_EAU_ACIDE      ("9.1",   "Bordures de plan d'eau (lac) - ZH acide"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    BORDURES_PLAN_EAU_ALCALINE   ("9.2",   "Bordures de plan d'eau (lac) - ZH alcaline"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    MARAIS_LANDES_TOURB          ("10.1",  "Marais et landes humides de plaine - tourbière de plaine"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    MARAIS_LANDES_PRAIRIES       ("10.2",  "Marais et landes humides de plaine - prairies humides"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    MARAIS_LANDES_PRES           ("10.3",  "Marais et landes humides de plaine - Prés salés continentaux"), // Indicateurs : 1, 2, 3, 6, 8, 9, 10, 11, 12, 13
    ZH_PONCT_MARE_SAUMATRE       ("11.11", "Zones humides ponctuelles - Mare temporaire saumâtre"), // Indicateurs : 1, 2, 3, 6, 8, 9, 10, 11, 12, 13
    ZH_PONCT_MARE_ALCALINE       ("11.12", "Zones humides ponctuelles - Mare temporaire alcaline"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_PONCT_MARE_ACIDE          ("11.13", "Zones humides ponctuelles - Mare temporaire acide"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_PONCT_MARE_PERMANENTE     ("11.2",  "Zones humides ponctuelles - Mare permanente"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    MARAIS_AMENAGES_AGRICOLE     ("12",    "Marais aménagés dans un but agricole"), // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13
    ZH_ARTIFICELLES              ("13",    "Zones humides artificielles"); // Indicateurs : 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13

    private final String code;
    private final String value;

    HumidZoneType(final String code, final String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static HumidZoneType getByCode(final String code) {
        for (final HumidZoneType candid : values()) {
            if (candid.getCode().equals(code)) {
                return candid;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return code +" "+ value;
    }
}
