This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit f11ac3ab84c28f8550457d523c752d2c8a4ec876 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Feb 3 19:13:42 2015 +0100 suppression des vieux signes --- .../fr/ifremer/tutti/service/bigfin/Signs.java | 216 --------------------- 1 file changed, 216 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/bigfin/Signs.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/bigfin/Signs.java deleted file mode 100644 index babbe08..0000000 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/bigfin/Signs.java +++ /dev/null @@ -1,216 +0,0 @@ -package fr.ifremer.tutti.service.bigfin; - -/* - * #%L - * Tutti :: Service - * %% - * Copyright (C) 2012 - 2014 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmId; -import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueId; -import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; -import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; -import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValues; - -import java.util.Map; - -/** - * Created on 5/14/14. - * - * @author Tony Chemit <chemit@codelutin.com> - * @since 3.4.2 - */ -public enum Signs { - - // sexe, M= mâle ; F = femelle ; not set = non sexé - NOT_SEXED("NOT SET") { - @Override - public Integer getCategory() { - return PmfmId.SEX.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.NON_SEXED_SEX.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return true; - } - }, - MALE("M") { - @Override - public Integer getCategory() { - return PmfmId.SEX.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SEX_MALE.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }, - FEMALE("F") { - @Override - public Integer getCategory() { - return PmfmId.SEX.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SEX_FEMALE.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }, - - // classe de taille, 1 = petit ; 2 = gros ; 0 = pas de classe de taille (saisie libre donc risque fort de mauvaise saisie) - NOT_SIZED("0") { - @Override - public Integer getCategory() { - return PmfmId.SIZE_CATEGORY.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.UNSORTED.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return true; - } - - }, - SMALL("1") { - @Override - public Integer getCategory() { - return PmfmId.SIZE_CATEGORY.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SIZE_SMALL.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }, - BIG("2") { - @Override - public Integer getCategory() { - return PmfmId.SIZE_CATEGORY.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SIZE_BIG.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }, - - // vrac / hors vrac - VRAC("") { - @Override - public Integer getCategory() { - return PmfmId.SORTED_UNSORTED.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SORTED_VRAC.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }, - HORS_VRAC("HV") { - @Override - public Integer getCategory() { - return PmfmId.SORTED_UNSORTED.getValue(); - } - - @Override - public Integer getQualitativeValueId() { - return QualitativeValueId.SORTED_HORS_VRAC.getValue(); - } - - @Override - public boolean isNullEquivalent() { - return false; - } - }; - - private String sign; - - Signs(String sign) { - this.sign = sign; - } - - public String getSign() { - return sign; - } - - public static Signs getSign(String sign) { - Signs result = getSign(sign, null); - return result; - } - - public static Signs getSign(String sign, Integer categoryId) { - Signs result = null; - for (Signs s : values()) { - if (s.sign.equals(sign) && - (categoryId == null || s.getCategory().equals(categoryId))) { - result = s; - break; - } - } - return result; - } - - public abstract Integer getCategory(); - - public abstract Integer getQualitativeValueId(); - - // if true, can use this value in the import file to replace a skipped category - public abstract boolean isNullEquivalent(); - - public void registerSign(Caracteristic caracteristic, - Map<Signs, CaracteristicQualitativeValue> map) { - Integer valueId = getQualitativeValueId(); - CaracteristicQualitativeValue result = CaracteristicQualitativeValues.getQualitativeValue(caracteristic, valueId); - map.put(this, result); - } -} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.