/**
 * 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.data.reference;

import fr.cenra.rhomeo.api.data.Reference;

/**
 * Orthopterans indicator reference representation.
 *
 *       Colonne      |          Type          | Modificateurs
 * -------------------+------------------------+---------------
 *  cd_nom            | integer                | non NULL
 *  cd_ref            | integer                |
 *  lb_nom            | character varying(255) |
 *  pres_lr           | integer                |
 *  pres_ra           | integer                |
 *  pres_paca         | integer                |
 *  hs_code           | integer                |
 *  hs_val            | integer                |
 *  dm_code           | integer                |
 *  dm_val            | integer                |
 *  mediterraneen1_ml | integer                |
 *  mediterraneen1_ma | integer                |
 *  mediterraneen2_ma | integer                |
 *  mediterraneen2_tb | integer                |
 *  alpin_ma          | integer                |
 *  alpin_tb          | integer                |
 *  continental_ma    | integer                |
 *  continental_tb    | integer                |
 *
 * (Source : base issue du script RhoMéO_Geomatys.backup)
 *
 * @author Samuel Andrés (Geomatys)
 */
public class OrthopteraIndicatorReference implements Reference {

    /**
     * CD_REF of the reference taxon.
     */
    private int cd_ref;

    private int mediterraneen1_ml;// Pourquoi pas booleen ?
    private int mediterraneen1_ma;// Pourquoi pas booleen ?
    private int mediterraneen2_ma;// Pourquoi pas booleen ?
    private int mediterraneen2_tb;// Pourquoi pas booleen ?
    private int alpin_ma;// Pourquoi pas booleen ?
    private int alpin_tb;// Pourquoi pas booleen ?
    private int continental_ma;// Pourquoi pas booleen ?
    private int continental_tb;// Pourquoi pas booleen ?

    /**
     * Name of the taxon.
     */
    private String lb_nom;

    private int hs_code;

    /**
     * Environment humidity
     */
    private int hs_val;

    private int dm_code;

    /**
     * Sedimentary dynamics
     */
    private int dm_val;

    public int getCd_ref() {
        return cd_ref;
    }

    public void setCd_ref(int cd_ref) {
        this.cd_ref = cd_ref;
    }

    public int getMediterraneen1_ml() {
        return mediterraneen1_ml;
    }

    public void setMediterraneen1_ml(int mediterraneen1_ml) {
        this.mediterraneen1_ml = mediterraneen1_ml;
    }

    public int getMediterraneen1_ma() {
        return mediterraneen1_ma;
    }

    public void setMediterraneen1_ma(int mediterraneen1_ma) {
        this.mediterraneen1_ma = mediterraneen1_ma;
    }

    public int getMediterraneen2_ma() {
        return mediterraneen2_ma;
    }

    public void setMediterraneen2_ma(int mediterraneen2_ma) {
        this.mediterraneen2_ma = mediterraneen2_ma;
    }

    public int getMediterraneen2_tb() {
        return mediterraneen2_tb;
    }

    public void setMediterraneen2_tb(int mediterraneen2_tb) {
        this.mediterraneen2_tb = mediterraneen2_tb;
    }

    public int getAlpin_ma() {
        return alpin_ma;
    }

    public void setAlpin_ma(int alpin_ma) {
        this.alpin_ma = alpin_ma;
    }

    public int getAlpin_tb() {
        return alpin_tb;
    }

    public void setAlpin_tb(int alpin_tb) {
        this.alpin_tb = alpin_tb;
    }

    public int getContinental_ma() {
        return continental_ma;
    }

    public void setContinental_ma(int continental_ma) {
        this.continental_ma = continental_ma;
    }

    public int getContinental_tb() {
        return continental_tb;
    }

    public void setContinental_tb(int continental_tb) {
        this.continental_tb = continental_tb;
    }

    public String getLb_nom() {
        return lb_nom;
    }

    public void setLb_nom(String lb_nom) {
        this.lb_nom = lb_nom;
    }

    public int getHs_code() {
        return hs_code;
    }

    public void setHs_code(int hs_code) {
        this.hs_code = hs_code;
    }

    public int getHs_val() {
        return hs_val;
    }

    public void setHs_val(int hs_val) {
        this.hs_val = hs_val;
    }

    public int getDm_code() {
        return dm_code;
    }

    public void setDm_code(int dm_code) {
        this.dm_code = dm_code;
    }

    public int getDm_val() {
        return dm_val;
    }

    public void setDm_val(int dm_val) {
        this.dm_val = dm_val;
    }

    @Override
    public int hashCode() {
        return cd_ref;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final OrthopteraIndicatorReference other = (OrthopteraIndicatorReference) obj;
        return getCd_ref() == other.getCd_ref()
                && getHs_val() == other.getHs_val()
                && getDm_val() == other.getDm_val();
    }

    @Override
    public String toString() {
        return new StringBuilder().append(cd_ref).append(' ').append(lb_nom).toString();
    }

}
