Created
December 17, 2013 16:10
-
-
Save okram/8007471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Vertex extends Element { | |
static final String V = "v"; | |
static final String L_BRACKET = "["; | |
static final String R_BRACKET = "]"; | |
public default Set<String> getPropertyKeys() { | |
return this.getProperties().keySet(); | |
} | |
public Map<String, Iterable<Vertex.Property>> getProperties(); | |
public <V> Iterable<Vertex.Property<V>> getProperties(String key); | |
public default <V> Iterable<V> getValues(String key) { | |
return () -> (Iterator) StreamFactory.stream(getProperties(key)).filter(p -> p.isPresent()).map(p -> p.<V>getValue()).iterator(); | |
} | |
public <V> Vertex.Property<V> getProperty(String key); | |
public <V> Vertex.Property<V> setProperty(String key, V value); | |
public <V> Vertex.Property<V> addProperty(String key, V value); | |
public VertexQuery query(); | |
public Edge addEdge(String label, Vertex inVertex, Object... keyValues); | |
public default String toString() { | |
return V + L_BRACKET + this.getId() + R_BRACKET; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment