Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1542 aurelien 1
package org.tela_botanica.client.modeles.objets;
2
 
3
import com.google.gwt.user.client.Window;
4
 
5
public class InfosReferentielNom {
6
 
7
	private String code = null;
8
	private String version = null;
9
	private String versionCourte = null;
10
	private String intitule = null;
11
 
12
	public InfosReferentielNom(String infosReferentiel) {
13
		String[] codeCompletIntitule = infosReferentiel.split(",");
14
		intitule = codeCompletIntitule[1];
15
 
16
		String[] codeVersion = codeCompletIntitule[0].split(":");
17
		code = codeVersion[0];
1744 raphael 18
		if(codeVersion.length > 1) {
19
			version = codeVersion[1];
20
			versionCourte = formaterVersionCourte(version);
21
		} else {
22
			version = versionCourte = null;
23
		}
1542 aurelien 24
	}
25
 
26
	public InfosReferentielNom(String code, String version, String intitule) {
27
		super();
28
		this.code = code;
29
		this.version = version;
30
		this.intitule = intitule;
31
		this.versionCourte = formaterVersionCourte(version);
32
	}
33
 
34
	private String formaterVersionCourte(String version) {
35
		return version.replaceAll("v","");
36
	}
37
 
38
	public String getCodeVersionComplet() {
39
		return code+":"+version;
40
	}
41
 
42
	public String getCode() {
43
		return code;
44
	}
45
	public void setCode(String code) {
46
		this.code = code;
47
	}
48
	public String getVersion() {
49
		return version;
50
	}
51
	public void setVersion(String version) {
52
		this.version = version;
53
	}
54
	public String getIntitule() {
55
		return intitule;
56
	}
57
	public void setIntitule(String intitule) {
58
		this.intitule = intitule;
59
	}
60
 
61
	public String getVersionCourte() {
62
		return versionCourte;
63
	}
64
 
65
	public void setVersionCourte(String versionCourte) {
66
		this.versionCourte = versionCourte;
67
	}
68
}