use of com.thinkaurelius.titan.graphdb.types.IndexDefinition in project titan by thinkaurelius.
the class TitanKeyVertex method getIndexList.
private List<IndexDefinition> getIndexList(Class<? extends Element> type) {
Preconditions.checkArgument(type == Vertex.class || type == Edge.class, "Expected Vertex or Edge class as argument");
List<IndexDefinition> result = type == Vertex.class ? vertexIndexes : edgeIndexes;
if (result == null) {
// Build it
ImmutableList.Builder b = new ImmutableList.Builder();
for (IndexDefinition it : getIndexes()) if (type.isAssignableFrom(it.getElementType()))
b.add(it);
result = b.build();
if (type == Vertex.class)
vertexIndexes = result;
else if (type == Edge.class)
edgeIndexes = result;
}
return result;
}
Aggregations