graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientBaseGraph.java
public OrientElement getElement(final Object id) {
    makeActive();

    if (null == id)
      throw new IllegalArgumentException("id cannot be null");

    if (id instanceof OrientElement)
      return (OrientElement) id;

    OIdentifiable rec;
    if (id instanceof OIdentifiable)
      rec = (OIdentifiable) id;
    else
      try {
        rec = new ORecordId(id.toString());
      } catch (IllegalArgumentException iae) {
        // orientdb throws IllegalArgumentException: Argument 'xxxx' is
        // not a RecordId in form of string. Format must be:
        // <cluster-id>:<cluster-position>
        return null;
      }

    final ODocument doc = rec.getRecord();
    if (doc != null) {
      final OImmutableClass schemaClass = ODocumentInternal.getImmutableSchemaClass(doc);
      if (schemaClass != null && schemaClass.isEdgeType())
        return getEdge(doc);
      else
        return getVertexInstance(doc);
    }

    return null;
  }
public OrientElement getElement(final Object id) {
    makeActive();

    if (null == id)
      throw new IllegalArgumentException("id cannot be null");

    if (id instanceof OrientElement)
      return (OrientElement) id;

    OIdentifiable rec;
    if (id instanceof OIdentifiable)
      rec = (OIdentifiable) id;
    else
      try {
        rec = new ORecordId(id.toString());
      } catch (IllegalArgumentException iae) {
        // orientdb throws IllegalArgumentException: Argument 'xxxx' is
        // not a RecordId in form of string. Format must be:
        // <cluster-id>:<cluster-position>
        return null;
      }

    final ODocument doc = rec.getRecord();
    if (doc != null) {
      final OImmutableClass schemaClass = ODocumentInternal.getImmutableSchemaClass(doc);
      if (schemaClass != null && schemaClass.isEdgeType())
        return getEdge(doc);
      else
        return getVertexInstance(doc);
    }

    return null;
  }
public OrientElement getElement ( final Object id ) { makeActive ( ) ; if ( null == id ) throw new IllegalArgumentException ( "id cannot be null" ) ; if ( id instanceof OrientElement ) return ( OrientElement ) id ; OIdentifiable rec ; if ( id instanceof OIdentifiable ) rec = ( OIdentifiable ) id ; else try { rec = new ORecordId ( id . toString ( ) ) ; } catch ( IllegalArgumentException iae ) { // orientdb throws IllegalArgumentException: Argument 'xxxx' is // not a RecordId in form of string. Format must be: // <cluster-id>:<cluster-position> return null ; } final ODocument doc = rec . getRecord ( ) ; if ( doc != null ) { final OImmutableClass schemaClass = ODocumentInternal . getImmutableSchemaClass ( doc ) ; if ( schemaClass != null && schemaClass . isEdgeType ( ) ) return getEdge ( doc ) ; else return getVertexInstance ( doc ) ; } return null ; }
Returns a graph element, vertex or edge, starting from an ID.

@param id Can by a String, ODocument or an OIdentifiable object.

@return OrientElement subclass such as OrientVertex or OrientEdge
Returns a graph element vertex or edge starting from an ID .