01: package org.romaframework.module.admin.domain;
02:
03: import org.romaframework.aspect.core.annotation.AnnotationConstants;
04: import org.romaframework.aspect.core.annotation.CoreClass;
05: import org.romaframework.aspect.view.annotation.ViewField;
06:
07: @CoreClass(orderFields="key description value")
08: public class EnvironmentItem {
09: private String key;
10: private String description;
11: private String value;
12:
13: @ViewField(visible=AnnotationConstants.FALSE)
14: private byte type;
15:
16: public static byte TYPE_STRING = 0;
17: public static byte TYPE_INTEGER = 1;
18: public static byte TYPE_FLOAT = 2;
19: public static byte TYPE_BOOLEAN = 3;
20:
21: public EnvironmentItem(String iKey) {
22: key = iKey;
23: type = TYPE_STRING;
24: }
25:
26: public EnvironmentItem(String key, String value) {
27: this .key = key;
28: this .value = value;
29: }
30:
31: @Override
32: public String toString() {
33: return key != null ? key : "" + " = " + value != null ? value
34: : "";
35: }
36:
37: @Override
38: public boolean equals(Object obj) {
39: if (!(obj instanceof EnvironmentItem))
40: return false;
41:
42: EnvironmentItem other = (EnvironmentItem) obj;
43: if (key == null || other.key == null || !key.equals(other.key))
44: return false;
45: return true;
46: }
47:
48: @Override
49: public int hashCode() {
50: if (key == null)
51: return -1;
52: return key.hashCode();
53: }
54:
55: public String getKey() {
56: return key;
57: }
58:
59: public void setKey(String key) {
60: this .key = key;
61: }
62:
63: public String getValue() {
64: return value;
65: }
66:
67: public void setValue(String value) {
68: this .value = value;
69: }
70:
71: public String getDescription() {
72: return description;
73: }
74:
75: public void setDescription(String description) {
76: this .description = description;
77: }
78:
79: public byte getType() {
80: return type;
81: }
82:
83: public void setType(byte type) {
84: this.type = type;
85: }
86: }
|