@Test public void testBaseFields() { Entity entity = new Entity( "test" ); final UUID version = UUIDGenerator.newTimeUUID(); EntityUtils.setVersion( entity, version ); final ApplicationScope scope = new ApplicationScopeImpl( createId( "application" ) ); final IndexEdge indexEdge = new IndexEdgeImpl( createId( "source" ), "testEdgeType", SearchEdge.NodeType.SOURCE, 1000 ); final Map<String, Object> entityMap = EntityToMapConverter.convert( scope, indexEdge, entity ); final String applicationId = entityMap.get( IndexingUtils.APPLICATION_ID_FIELDNAME ).toString(); assertEquals( IndexingUtils.applicationId( scope.getApplication() ), applicationId ); final String entityIdString = entityMap.get( IndexingUtils.ENTITY_ID_FIELDNAME ).toString(); assertEquals( IndexingUtils.entityId( entity.getId() ), entityIdString ); final String versionString = entityMap.get( IndexingUtils.ENTITY_VERSION_FIELDNAME ).toString(); assertEquals( versionString, version.toString() ); final String entityTypeString = entityMap.get( IndexingUtils.ENTITY_TYPE_FIELDNAME ).toString(); assertEquals( IndexingUtils.getType( scope, entity.getId() ), entityTypeString ); final String nodeIdString = entityMap.get( IndexingUtils.EDGE_NODE_ID_FIELDNAME ).toString(); assertEquals( IndexingUtils.nodeId( indexEdge.getNodeId() ), nodeIdString ); final String edgeName = entityMap.get( IndexingUtils.EDGE_NAME_FIELDNAME ).toString(); assertEquals( indexEdge.getEdgeName(), edgeName ); final String nodeType = entityMap.get( IndexingUtils.EDGE_NODE_TYPE_FIELDNAME ).toString(); assertEquals( indexEdge.getNodeType().toString(), nodeType ); final long edgeTimestamp = ( long ) entityMap.get( IndexingUtils.EDGE_TIMESTAMP_FIELDNAME ); assertEquals( indexEdge.getTimestamp(), edgeTimestamp ); final String edgeSearch = entityMap.get( IndexingUtils.EDGE_SEARCH_FIELDNAME ).toString(); assertEquals( IndexingUtils.createContextName( scope, indexEdge ), edgeSearch ); final Set<EntityField> fieldsSet = ( Set<EntityField> ) entityMap.get( IndexingUtils.ENTITY_FIELDS ); assertEquals( 0, fieldsSet.size() ); }
public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); } }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity); static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity, Optional<Set<String>> fieldsToIndex); }
EntityToMapConverter { public static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge, final Entity entity) { return convert( applicationScope, indexEdge, entity, Optional.absent() ); }  static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity); static Map<String, Object> convert(ApplicationScope applicationScope, final IndexEdge indexEdge,
                                              final Entity entity, Optional<Set<String>> fieldsToIndex);  }