OPropertyIndexDefinition extends ODocumentWrapperNoClass implements OIndexDefinition { public Object getDocumentValueToIndex(final ODocument iDocument) { if (OType.LINK.equals(keyType)) { final OIdentifiable identifiable = iDocument.field(field, OType.LINK); if (identifiable != null) return createValue(identifiable.getIdentity()); else return null; } return createValue(iDocument.field(field)); } OPropertyIndexDefinition(final String iClassName, final String iField, final OType iType);  OPropertyIndexDefinition(); String getClassName(); List<String> getFields(); List<String> getFieldsToIndex(); Object getDocumentValueToIndex(final ODocument iDocument); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); Object createValue(final List<?> params); Object createValue(final Object... params); int getParamCount(); OType[] getTypes(); @Override final ODocument toStream(); String toCreateIndexDDL(final String indexName, final String indexType);  }
@Test public void testGetDocumentValueToIndex() { final ODocument document = new ODocument(); document.field("fOne", "15"); document.field("fTwo", 10); final Object result = propertyIndex.getDocumentValueToIndex(document); Assert.assertEquals(result, 15); }