Subversion Repositories eFlore/Applications.cel

Rev

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

package org.tela_botanica.client.modeles.objets;

import org.tela_botanica.client.i18n.Msg;

public class InfosReferentielNom {
        
        private String code = null;
        private String version = null;
        private String versionCourte = null;
        private String intitule = null;

        public InfosReferentielNom(String infosReferentiel) {
                
                String[] codeVersion = infosReferentiel.split(":");
                code = codeVersion[0];
                intitule = Msg.get("referentiel-"+code);
                if(codeVersion.length > 1) {
                        version = codeVersion[1];
                        versionCourte = formaterVersionCourte(version);
                } else {
                        version = versionCourte = null;
                }
        }
        
        public InfosReferentielNom(String code, String version, String intitule) {
                super();
                this.code = code;
                this.version = version;
                this.intitule = intitule;
                this.versionCourte = formaterVersionCourte(version);
        }
        
        private String formaterVersionCourte(String version) {
                return version.replaceAll("v","");
        }
        
        public String getCodeVersionComplet() {
                return code+":"+version;
        }
        
        public String getCode() {
                return code;
        }
        public void setCode(String code) {
                this.code = code;
        }
        public String getVersion() {
                return version;
        }
        public void setVersion(String version) {
                this.version = version;
        }
        public String getIntitule() {
                return intitule;
        }
        public void setIntitule(String intitule) {
                this.intitule = intitule;
        }

        public String getVersionCourte() {
                return versionCourte;
        }

        public void setVersionCourte(String versionCourte) {
                this.versionCourte = versionCourte;
        }       
}