7
|
1 package models;
|
|
2
|
8
|
3 import java.util.HashMap;
|
|
4
|
7
|
5 import com.tinkerpop.blueprints.Vertex;
|
|
6
|
|
7 public class UserModel extends NodeModel {
|
|
8
|
8
|
9 protected final String CONSENSUS = "consensus";
|
|
10 protected final String CLAIMS = "claims";
|
|
11 protected final String REQUESTS = "requests";
|
|
12
|
|
13 protected HashMap<Object,Object> properties = new HashMap<Object,Object>();
|
7
|
14
|
|
15 public UserModel(Vertex vertex) {
|
|
16 super(vertex);
|
|
17 }
|
|
18
|
8
|
19
|
|
20 public void setUserInfo() {
|
|
21 this.vertex.setProperty(CONSENSUS, "");
|
|
22 this.vertex.setProperty(CLAIMS, "");
|
|
23 this.vertex.setProperty(REQUESTS, "");
|
|
24 }
|
|
25
|
|
26
|
|
27 public HashMap<Object,Object> getUserProperty() {
|
|
28 for (String key : vertex.getPropertyKeys()) {
|
|
29 properties.put(key, vertex.getProperty(key));
|
|
30 }
|
|
31 return properties;
|
|
32 }
|
|
33
|
|
34
|
|
35
|
|
36 /*
|
7
|
37 public Vertex setName(String name) {
|
|
38 this.vertex.setProperty(NAME, name);
|
|
39 return vertex;
|
|
40 }
|
8
|
41 */
|
7
|
42
|
|
43
|
|
44
|
|
45 }
|