public static Identifier fromUUID( UUID uuid ) { if ( uuid == null ) { return null; } return new Identifier( Type.UUID, uuid ); }
@Override public Identifier getIdentifier() { return Identifier.from( entityId ); } }
public PipelineContext( final ApplicationScope applicationScope, final RequestCursor requestCursor, final int limit, final int id, boolean keepStaleEntries, String query ) { this.applicationScope = applicationScope; this.id = id; this.keepStaleEntries = keepStaleEntries; this.query = query; this.parsedQuery = ParsedQueryBuilder.build(query); if (parsedQuery != null && parsedQuery.isDirectQuery()) { // for direct query, use no limit or cursor this.limit = MAX_LIMIT + 1; this.requestCursor = new RequestCursor(Optional.absent()); } else { this.limit = limit; this.requestCursor = requestCursor; } }
public static Query fromUUID( UUID uuid ) { Query q = new Query(); q.addIdentifier( Identifier.fromUUID( uuid ) ); return q; }
@Test public void orderByGrammar() throws QueryParseException { String s = "select * where name = 'bob' order by name asc"; ParsedQuery query = ParsedQueryBuilder.build( s ); assertEquals( 1, query.getSortPredicates().size() ); }
public static Query fromName( String name ) { Query q = new Query(); q.addIdentifier( Identifier.fromName( name ) ); return q; }
public void setValue( Object value ) { if ( isUUID() && value instanceof String ) { value = UUID.fromString( ( String ) value ); } this.value = value; } }
public static Query fromEmail( String email ) { Query q = new Query(); q.addIdentifier( Identifier.fromEmail( email ) ); return q; }
public long next( long timestamp ) { return round( timestamp ) + interval; }
public SortPredicate( String propertyName, String direction ) { this( propertyName, SortDirection.find( direction ) ); }
@Override public int hashCode() { int result = propertyName.hashCode(); result = ( 31 * result ) + direction.hashCode(); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( type == null ) ? 0 : type.hashCode() ); result = prime * result + ( ( value == null ) ? 0 : value.hashCode() ); return result; }
public static Query fromUUID( UUID uuid ) { Query q = new Query(); q.addIdentifier( Identifier.fromUUID( uuid ) ); return q; }
@Override public Identifier getIdentifier() { return Identifier.from( name ); } }
public static Identifier fromName( String name ) { if ( name == null ) { return null; } return new Identifier( Type.NAME, name ); }
public static Query fromIdentifier( Object id ) { Query q = new Query(); q.addIdentifier( Identifier.from( id ) ); return q; }
public static Identifier fromEmail( String email ) { if ( email == null ) { return null; } return new Identifier( Type.EMAIL, email ); }