/** * Parse an Entity identity to an EntityReference. * @param identity the EntityReference identity * @return the EntityReference represented by the given identity */ public static EntityReference parseEntityReference( String identity ) { return new EntityReference( identity ); }
/** * @param object an EntityComposite * @return the EntityReference for the given EntityComposite */ public static EntityReference entityReferenceFor( Object object ) { return new EntityReference( (EntityComposite) object ); }
/** * Parse an URI to an EntityReference. * @param uri the URI to parse * @return the EntityReference represented by the given URI */ public static EntityReference parseURI( String uri ) { String identity = uri.substring( "urn:qi4j:entity:".length() ); return new EntityReference( identity ); }
public static EntityReference create( Identity identity ) { if( identity == null ) return null; return new EntityReference( identity.identity().get() ); }
private boolean processRow( long row, BindingSet bindingSet, QualifiedIdentityResultCallback callback ) { final Value identifier = bindingSet.getValue( "identity" ); //TODO Shall we throw an exception if there is no binding for identifier = query parser is not right if( identifier == null ) { return true; } final String identity = identifier.stringValue(); final EntityReference entityReference = new EntityReference( identity ); return callback.processRow( row, entityReference ); }