protected static void checkType(final OClass iType) { if (iType == null) throw new IllegalArgumentException("Vertex class is null"); if (((iType instanceof OImmutableClass) && !((OImmutableClass) iType).isVertexType()) || !iType.isSubClassOf(CLASS_NAME)) throw new IllegalArgumentException("Type error. The class '" + iType + "' does not extend class '" + CLASS_NAME + "' and therefore cannot be considered a Vertex"); }
protected Object v2v(final OrientBaseGraph graph, final OIdentifiable iRecord, final Direction iDirection, final String[] iLabels) { final ODocument rec = iRecord.getRecord(); OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(rec); if (immutableClass != null && immutableClass.isVertexType()) { // VERTEX final OrientVertex vertex = graph.getVertex(rec); if (vertex != null) return vertex.getVertices(iDirection, iLabels); } return null; }
protected Object v2e(final OrientBaseGraph graph, final OIdentifiable iRecord, final Direction iDirection, final String[] iLabels) { final ODocument rec = iRecord.getRecord(); OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(rec); if (immutableClass != null && immutableClass.isVertexType()) { // VERTEX final OrientVertex vertex = graph.getVertex(rec); if (vertex != null) return vertex.getEdges(iDirection, iLabels); } return null; }
else { final OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(record); if (immutableClass == null || (!immutableClass.isVertexType() && !immutableClass.isEdgeType())) if (immutableClass.isVertexType()) {
else { final OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(record); if (immutableClass == null || (!immutableClass.isVertexType() && !immutableClass.isEdgeType())) if (immutableClass.isVertexType()) {
@Override public OIdentifiable getGraphElementRecord(final Object iObject) { final ORecord rec = ((OIdentifiable) iObject).getRecord(); if (rec == null || !(rec instanceof ODocument)) return null; final ODocument value = (ODocument) rec; final OIdentifiable v; OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(value); if (immutableClass.isVertexType()) { // DIRECT VERTEX v = value; } else if (immutableClass.isEdgeType()) { // EDGE if (vertex.settings.isUseVertexFieldsForEdgeLabels() || OrientEdge.isLabeled(OrientEdge.getRecordLabel(value), iLabels)) v = OrientEdge.getConnection(value, connection.getKey().opposite()); else v = null; } else throw new IllegalStateException("Invalid content found between connections: " + value); return v; }
break; } else if (ODocumentInternal.getImmutableSchemaClass(curr).isVertexType()) { final Direction direction = OrientVertex.getConnectionDirection(iFieldName, useVertexFieldsForEdgeLabels);
if (!ODocumentInternal.getImmutableSchemaClass(this, outDocument).isVertexType()) throw new IllegalArgumentException("source record is not a vertex"); if (!ODocumentInternal.getImmutableSchemaClass(this, outDocument).isVertexType()) throw new IllegalArgumentException("destination record is not a vertex");
throw new IllegalArgumentException("source vertex is invalid (rid=" + currentVertex.getIdentity() + ")"); if (!ODocumentInternal.getImmutableSchemaClass(outDocument).isVertexType()) throw new IllegalArgumentException("source record is not a vertex"); throw new IllegalArgumentException("destination vertex is invalid (rid=" + inVertex.getIdentity() + ")"); if (!ODocumentInternal.getImmutableSchemaClass(outDocument).isVertexType()) throw new IllegalArgumentException("destination record is not a vertex");
if (!ODocumentInternal.getImmutableSchemaClass(outDocument).isVertexType()) throw new IllegalArgumentException("source record is not a vertex"); if (!ODocumentInternal.getImmutableSchemaClass(inDocument).isVertexType()) throw new IllegalArgumentException("destination record is not a vertex");
if (immutableSchema.isVertexType()) {