Mercurial > hg > Members > nobuyasu > Consensus
view app/models/UserModel.java @ 9:d050b7fb4cda
create getUserRequests action
author | one |
---|---|
date | Mon, 01 Oct 2012 20:23:19 +0900 |
parents | 7b314898fddd |
children | a8ea4191fa99 |
line wrap: on
line source
package models; import java.util.HashMap; import com.tinkerpop.blueprints.Vertex; public class UserModel extends NodeModel { protected final String CONSENSUS = "consensus"; protected final String CLAIMS = "claims"; protected final String REQUESTS = "requests"; protected HashMap<Object,Object> properties = new HashMap<Object,Object>(); public UserModel(Vertex vertex) { super(vertex); } public void setUserInfo() { this.vertex.setProperty(CONSENSUS, ""); this.vertex.setProperty(CLAIMS, ""); this.vertex.setProperty(REQUESTS, ""); } public HashMap<Object,Object> getUserProperty() { for (String key : vertex.getPropertyKeys()) { properties.put(key, vertex.getProperty(key)); } return properties; } public HashMap<Object, Object> getUserRequests() { HashMap<Object, Object> hash = new HashMap<Object,Object>(1); hash.put(REQUESTS, vertex.getProperty(REQUESTS)); return hash; } /* public Vertex setName(String name) { this.vertex.setProperty(NAME, name); return vertex; } */ }