View Javadoc

1   package eu.ehri.project.acl.wrapper;
2   
3   import com.tinkerpop.blueprints.Element;
4   import com.tinkerpop.blueprints.util.ElementHelper;
5   
6   
7   import java.util.Set;
8   
9   
10  public abstract class AclElement implements Element {
11      protected Element baseElement;
12      protected AclGraph<?> aclGraph;
13  
14      protected AclElement(Element baseElement, AclGraph<?> aclGraph) {
15          this.baseElement = baseElement;
16          this.aclGraph = aclGraph;
17      }
18  
19      @Override
20      public <T> T getProperty(String s) {
21          return baseElement.getProperty(s);
22      }
23  
24      @Override
25      public Set<String> getPropertyKeys() {
26          return baseElement.getPropertyKeys();
27      }
28  
29      @Override
30      public void setProperty(String s, Object o) {
31          baseElement.setProperty(s, o);
32      }
33  
34      @Override
35      public <T> T removeProperty(String s) {
36          return baseElement.removeProperty(s);
37      }
38  
39      @Override
40      public void remove() {
41          baseElement.remove();
42      }
43  
44      @Override
45      public Object getId() {
46          return baseElement.getId();
47      }
48  
49      @Override
50      public String toString() {
51          return "[" + getId() + ")]";
52      }
53  
54      @Override
55      public boolean equals(Object object) {
56          return ElementHelper.areEqual(this, object);
57      }
58  
59      @Override
60      public int hashCode() {
61          // NB: Deliberate decision to ignore
62          // accessor when calculating hashCode
63          // or equality.
64          return baseElement.hashCode();
65      }
66  
67      public Element getBaseElement() {
68          return baseElement;
69      }
70  }