graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientElement.java
@Override public <T> T getProperty(final String key) {
    if (key == null)
      return null;

    final OrientBaseGraph graph = getGraph();
    if (key.equals("_class"))
      return (T) ODocumentInternal.getImmutableSchemaClass(getRecord()).getName();
    else if (key.equals("_version"))
      return (T) new Integer(getRecord().getVersion());
    else if (key.equals("_rid"))
      return (T) rawElement.getIdentity().toString();

    final ODocument record = getRecord();
    if (record == null)
      // NO RECORD
      return null;

    final Object fieldValue = record.field(key);
    if (graph != null && fieldValue instanceof OIdentifiable && !(((OIdentifiable) fieldValue).getRecord() instanceof OBlob)) {
      ODocument fieldRecord = ((OIdentifiable) fieldValue).getRecord();
      if (fieldRecord != null) {
        final OClass schemaClass = fieldRecord.getSchemaClass();
        if (schemaClass != null && (schemaClass.isVertexType() || schemaClass.isEdgeType())) {
          // CONVERT IT TO VERTEX/EDGE
          return (T) graph.getElement(fieldValue);
        }
      }
      return (T) fieldValue;
    } else if (!(fieldValue instanceof Map) && OMultiValue.isMultiValue(fieldValue) && OMultiValue
        .getFirstValue(fieldValue) instanceof OIdentifiable) {
      final OIdentifiable firstValue = (OIdentifiable) OMultiValue.getFirstValue(fieldValue);

      if (firstValue instanceof ODocument) {
        final ODocument document = (ODocument) firstValue;

        /// clusterId -2 Is considered a projection so does not have a class but is a not embedded record
        if (document.getIdentity().getClusterId() != -2 && (document.isEmbedded()
            || ODocumentInternal.getImmutableSchemaClass(document) == null))
          return (T) fieldValue;
      }

      if (graph != null)
        // CONVERT IT TO ITERABLE<VERTEX/EDGE>
        return (T) new OrientElementIterable<OrientElement>(graph, OMultiValue.getMultiValueIterable(fieldValue));
    }

    return (T) fieldValue;
  }
@Override public <T> T getProperty(final String key) {
    if (key == null)
      return null;

    final OrientBaseGraph graph = getGraph();
    if (key.equals("_class"))
      return (T) ODocumentInternal.getImmutableSchemaClass(getRecord()).getName();
    else if (key.equals("_version"))
      return (T) new Integer(getRecord().getVersion());
    else if (key.equals("_rid"))
      return (T) rawElement.getIdentity().toString();

    final ODocument record = getRecord();
    if (record == null)
      // NO RECORD
      return null;

    final Object fieldValue = record.field(key);
    if (graph != null && fieldValue instanceof OIdentifiable && !(((OIdentifiable) fieldValue).getRecord() instanceof OBlob)) {
      ODocument fieldRecord = ((OIdentifiable) fieldValue).getRecord();
      if (fieldRecord != null) {
        final OClass schemaClass = fieldRecord.getSchemaClass();
        if (schemaClass != null && (schemaClass.isVertexType() || schemaClass.isEdgeType())) {
          // CONVERT IT TO VERTEX/EDGE
          return (T) graph.getElement(fieldValue);
        }
      }
      return (T) fieldValue;
    } else if (!(fieldValue instanceof Map) && OMultiValue.isMultiValue(fieldValue) && OMultiValue
        .getFirstValue(fieldValue) instanceof OIdentifiable) {
      final OIdentifiable firstValue = (OIdentifiable) OMultiValue.getFirstValue(fieldValue);

      if (firstValue instanceof ODocument) {
        final ODocument document = (ODocument) firstValue;

        /// clusterId -2 Is considered a projection so does not have a class but is a not embedded record
        if (document.getIdentity().getClusterId() != -2 && (document.isEmbedded()
            || ODocumentInternal.getImmutableSchemaClass(document) == null))
          return (T) fieldValue;
      }

      if (graph != null)
        // CONVERT IT TO ITERABLE<VERTEX/EDGE>
        return (T) new OrientElementIterable<OrientElement>(graph, OMultiValue.getMultiValueIterable(fieldValue));
    }

    return (T) fieldValue;
  }
@ Override public < T > T getProperty ( final String key ) { if ( key == null ) return null ; final OrientBaseGraph graph = getGraph ( ) ; if ( key . equals ( "_class" ) ) return ( T ) ODocumentInternal . getImmutableSchemaClass ( getRecord ( ) ) . getName ( ) ; else if ( key . equals ( "_version" ) ) return ( T ) new Integer ( getRecord ( ) . getVersion ( ) ) ; else if ( key . equals ( "_rid" ) ) return ( T ) rawElement . getIdentity ( ) . toString ( ) ; final ODocument record = getRecord ( ) ; if ( record == null ) // NO RECORD return null ; final Object fieldValue = record . field ( key ) ; if ( graph != null && fieldValue instanceof OIdentifiable && ! ( ( ( OIdentifiable ) fieldValue ) . getRecord ( ) instanceof OBlob ) ) { ODocument fieldRecord = ( ( OIdentifiable ) fieldValue ) . getRecord ( ) ; if ( fieldRecord != null ) { final OClass schemaClass = fieldRecord . getSchemaClass ( ) ; if ( schemaClass != null && ( schemaClass . isVertexType ( ) || schemaClass . isEdgeType ( ) ) ) { // CONVERT IT TO VERTEX/EDGE return ( T ) graph . getElement ( fieldValue ) ; } } return ( T ) fieldValue ; } else if ( ! ( fieldValue instanceof Map ) && OMultiValue . isMultiValue ( fieldValue ) && OMultiValue . getFirstValue ( fieldValue ) instanceof OIdentifiable ) { final OIdentifiable firstValue = ( OIdentifiable ) OMultiValue . getFirstValue ( fieldValue ) ; if ( firstValue instanceof ODocument ) { final ODocument document = ( ODocument ) firstValue ; /// clusterId -2 Is considered a projection so does not have a class but is a not embedded record if ( document . getIdentity ( ) . getClusterId ( ) != - 2 && ( document . isEmbedded ( ) || ODocumentInternal . getImmutableSchemaClass ( document ) == null ) ) return ( T ) fieldValue ; } if ( graph != null ) // CONVERT IT TO ITERABLE<VERTEX/EDGE> return ( T ) new OrientElementIterable < OrientElement > ( graph , OMultiValue . getMultiValueIterable ( fieldValue ) ) ; } return ( T ) fieldValue ; }
Returns a Property value.

@param key Property name
@return Property value if any, otherwise NULL.
Returns a Property value .