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).getVertexLabel().equals(type); case EDGE: return ((TitanEdge)element).getEdgeLabel().equals(type); case PROPERTY: return ((TitanProperty)element).getPropertyKey().equals(type); default: throw new IllegalArgumentException(); } }