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