Subversion Repositories eFlore/Applications.coel

Rev

Rev 808 | Rev 948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
808 jpm 1
package org.tela_botanica.client.modeles;
2
 
3
import org.tela_botanica.client.util.UtilString;
4
 
5
import com.extjs.gxt.ui.client.data.BaseModelData;
6
 
7
public class UniteRangement extends BaseModelData {
8
 
9
	private static final long serialVersionUID = 394843761854792528L;
10
	public static final String COMPTE_EXACT = "E";
11
	public static final String COMPTE_APPROXIMATIF = "A";
12
 
13
	public UniteRangement() {
14
 
15
	}
16
 
17
	public UniteRangement(String type, int nombre, String precision, String format) {
18
		setType(type);
19
		setNombre(nombre);
20
		setPrecision(precision);
21
		setFormat(format);
831 jpm 22
		setTypeAutre(false);
808 jpm 23
	}
24
 
25
	public String getType() {
26
		return renvoyerValeurCorrecte((String) get("type"));
27
	}
28
	public void setType(String type) {
29
		set("type", type);
30
	}
31
 
32
	public String getNombre() {
33
		return get("nombre");
34
	}
35
	public void setNombre(int nombre) {
36
		set("nombre", nombre);
37
	}
38
 
39
	public String getPrecision() {
40
		return renvoyerValeurCorrecte((String) get("precision"));
41
	}
42
	public void setPrecision(String precision) {
43
		set("precision", precision);
44
	}
45
 
46
	public String getFormat() {
47
		return renvoyerValeurCorrecte((String) get("format"));
48
	}
49
	public void setFormat(String format) {
50
		set("format", format);
51
	}
52
 
831 jpm 53
	public boolean getTypeAutre() {
54
		return get("type_autre");
55
	}
56
	public void setTypeAutre(boolean bool) {
57
		set("type_autre", bool);
58
	}
59
 
808 jpm 60
	private String renvoyerValeurCorrecte(String valeur) {
61
		String valeurCorrecte = "";
62
		if (!UtilString.isEmpty(valeur)) {
63
			valeurCorrecte = valeur;
64
		}
65
		return valeurCorrecte;
66
	}
67
}