public boolean matchesConstraint(TitanSchemaType type, TitanElement element) { Preconditions.checkArgument(type != null && element!=null); assert isInstance(element); assert isValidConstraint(type); switch(this) { case VERTEX: return ((TitanVertex)element).vertexLabel().equals(type); case EDGE: return ((TitanEdge)element).edgeLabel().equals(type); case PROPERTY: return ((TitanVertexProperty)element).propertyKey().equals(type); default: throw new IllegalArgumentException(); } }
public boolean matchesConstraint(TitanSchemaType type, TitanElement element) { Preconditions.checkArgument(type != null && element!=null); assert isInstance(element); assert isValidConstraint(type); switch(this) { case VERTEX: return ((TitanVertex)element).vertexLabel().equals(type); case EDGE: return ((TitanEdge)element).edgeLabel().equals(type); case PROPERTY: return ((TitanVertexProperty)element).propertyKey().equals(type); default: throw new IllegalArgumentException(); } }