]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java
Add generate script
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / structure / SimpleSElement.java
1 package org.argeo.slc.core.structure;
2
3 import java.util.Map;
4 import java.util.TreeMap;
5
6 import org.argeo.slc.core.structure.tree.TreeSPath;
7 import org.argeo.slc.structure.StructureElement;
8
9 /**
10 * Basic implementation of <code>StructureElement</code>.
11 *
12 * @see TreeSPath
13 */
14 public class SimpleSElement implements StructureElement {
15 /** For ORM */
16 private Long tid;
17 private String label;
18 private Map<String, String> tags = new TreeMap<String, String>();
19
20 /** For ORM */
21 public SimpleSElement() {
22 }
23
24 /** Constructor */
25 public SimpleSElement(String label) {
26 this.label = label;
27 }
28
29 /** Constructor */
30 public SimpleSElement(String label, String defaultLabel) {
31 this(label != null ? label : defaultLabel);
32 }
33
34 /** Constructor */
35 public SimpleSElement(SimpleSElement sElement) {
36 setLabel(sElement.getLabel());
37 setTags(new TreeMap<String, String>(sElement.getTags()));
38 }
39
40 public String getLabel() {
41 return label;
42 }
43
44 /** Sets the label. */
45 public void setLabel(String label) {
46 this.label = label;
47 }
48
49 public Long getTid() {
50 return tid;
51 }
52
53 void setTid(Long tid) {
54 this.tid = tid;
55 }
56
57 public Map<String, String> getTags() {
58 return tags;
59 }
60
61 public void setTags(Map<String, String> tags) {
62 this.tags = tags;
63 }
64
65 @Override
66 public SimpleSElement clone() {
67 return new SimpleSElement(this);
68 }
69
70 }