Subversion Repositories eFlore/Applications.cel

Rev

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

package org.tela_botanica.client.modeles.objets;

import com.google.gwt.user.client.Window;

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

        public InfosReferentielNom(String infosReferentiel) {
                String[] codeCompletIntitule = infosReferentiel.split(",");
                intitule = codeCompletIntitule[1];
                
                String[] codeVersion = codeCompletIntitule[0].split(":");
                code = codeVersion[0];
                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;
        }       
}