Subversion Repositories eFlore/Applications.coel

Rev

Rev 1513 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.modeles.collection;

import org.tela_botanica.client.util.UtilString;

import com.extjs.gxt.ui.client.data.BaseModelData;

public class UniteRangement extends BaseModelData {
        
        private static final long serialVersionUID = 394843761854792528L;
        public static final String COMPTE_EXACT = "E";
        public static final String COMPTE_APPROXIMATIF = "A";
        
        public UniteRangement() {
                
        }
        
        public UniteRangement(String id, String type, int nombre, String precision, String format) {
                setId(id);
                setType(type);
                setNombre(nombre);
                setPrecision(precision);
                setFormat(format);
                setTypeAutre(false);
        }
        
        public String getId() {
                return renvoyerValeurCorrecte((String) get("id"));
        }
        public void setId(String id) {
                set("id", id);
        }
        
        public String getType() {
                return renvoyerValeurCorrecte((String) get("type"));
        }
        public void setType(String type) {
                set("type", type);
        }

        public double getNombre() {
                if (get("nombre") == null) {
                        return new Double(0);
                }
                return get("nombre");
        }
        public void setNombre(double nombre) {
                set("nombre", nombre);
        }
        
        public String getPrecision() {
                return renvoyerValeurCorrecte((String) get("precision"));
        }
        public void setPrecision(String precision) {
                set("precision", precision);
        }
        
        public String getFormat() {
                return renvoyerValeurCorrecte((String) get("format"));
        }
        public void setFormat(String format) {
                set("format", format);
        }
        
        public boolean getTypeAutre() {
                return get("type_autre");
        }
        public void setTypeAutre(boolean bool) {
                set("type_autre", bool);
        }
        
        private String renvoyerValeurCorrecte(String valeur) {
                String valeurCorrecte = "";
                if (!UtilString.isEmpty(valeur)) {
                        valeurCorrecte = valeur;
                }
                return valeurCorrecte;
        }
}