Subversion Repositories eFlore/Applications.del

Rev

Rev 461 | Rev 602 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.del.client.modeles;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Observation implements Serializable {

        private static final long serialVersionUID = 840032625524143547L;
        private String id, auteur, species, nomRetenu, famille, localite, idLocalite, dateTransmission, numNomenclatural, nomCommun, lieuDit, milieu, commentaire, dateReleve;

        private List<String> motsClefs = new ArrayList<String>();
        private List<PropositionDetermination> propositionsDetermination = new ArrayList<PropositionDetermination>();
        private List<Image> images = new ArrayList<Image>();

        public String getAuteur() {
                return auteur;
        }

        public void setAuteur(String auteur) {
                this.auteur = auteur;
        }

        public String getNomRetenu() {
                return nomRetenu;
        }

        public void setNomRetenu(String commonName) {
                this.nomRetenu = commonName;
        }

        public String getNomCommun() {
                return nomCommun;
        }
        
        public void setNomCommun(String nomCommun) {
                this.nomCommun = nomCommun;
        }
        
        public String getLieuDit() {
                return this.lieuDit;
        }
        
        public void setLieuDit(String lieuDit) {
                this.lieuDit = lieuDit;
        }
        
        public String getMilieu() {
                return milieu;
        }
        
        public void setMilieu(String milieu) {
                this.milieu = milieu;
        }
        
        public String getCommentaire() {
                return commentaire;
        }
        
        public void setCommentaire(String commentaire) {
                this.commentaire = commentaire;
        }
        
        public String getFamille() {
                return famille;
        }

        public void setFamille(String famille) {
                this.famille = famille;
        }

        public String getIdLocalite() {
                return idLocalite;
        }

        public void setIdLocalite(String idlocalite) {
                this.idLocalite = idlocalite;
        }
        
        public String getLocalite() {
                return localite;
        }
        
        public String getLocaliteAvecIdFormatee() {
                String localiteFormatee = this.localite;
                if(idLocalite != null && idLocalite.length() >= 2) {
                        localiteFormatee += " ("+idLocalite.substring(0, 2)+")";
                }
                
                return localiteFormatee;
        }

        public void setLocalite(String localite) {
                this.localite = localite;
        }

        public String getDateTransmission() {
                return dateTransmission;
        }
        
        public void setDateTransmission(String date) {
                this.dateTransmission = date;
        }

        public String getDateReleve() {
                return dateReleve;
        }
        
        public void setDateReleve(String dateReleve) {
                this.dateReleve = dateReleve;
        }
        
        public String getNumNomenclatural() {
                return numNomenclatural;
        }

        public void setNumNomenclatural(String numNomenclatural) {
                this.numNomenclatural = numNomenclatural;
        }

        public List<PropositionDetermination> getPropositionsDetermination() {
                return propositionsDetermination;
        }

        public void setImageCelValidationDatas(List<PropositionDetermination> propositionsDetermination) {
                this.propositionsDetermination = propositionsDetermination;
        }

        public List<String> getMotsClefs() {
                return motsClefs;
        }

        public void setMotsClefs(List<String> motsClefs) {
                this.motsClefs = motsClefs;
        }
        
        public void ajouterMotsClef(String motsClefs) {
                if (this.motsClefs == null) {
                        this.motsClefs = new ArrayList<String>();
                }
                this.motsClefs.add(motsClefs);
        }

        public void addImageCelValidationData(PropositionDetermination observationValidation) {
                propositionsDetermination.add(observationValidation);
        }

        public ArrayList<String> getPropositionsTaxonsData() {

                ArrayList<String> propositionsTaxonDatas = new ArrayList<String>();
                for (PropositionDetermination observationValidation : propositionsDetermination) {
                        String espece = observationValidation.getEspece();
                        if (espece != "" && !propositionsTaxonDatas.contains(espece)) {
                                propositionsTaxonDatas.add(observationValidation.getEspece());
                        }
                }

                return propositionsTaxonDatas;
        }

        public List<Image> getImages() {
                return images;
        }

        public void setImages(List<Image> images) {
                this.images = images;
        }

        public String getId() {
                return id;
        }

        public void setId(String id) {
                this.id = id;
        }

}