Created
June 20, 2011 06:32
-
-
Save musketyr/1035208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Canonical | |
class QueryBuilder { | |
String spreadsheet | |
String worksheet | |
String query | |
String order | |
String contains | |
boolean all | |
boolean reverse | |
int limit | |
int offset | |
List<Object> columns = [] | |
QueryBuilder sheet(String worksheet){ | |
this.worksheet = worksheet | |
this | |
} | |
QueryBuilder sort(Sort ascOrDesc){ | |
reverse = ascOrDesc == Sort.DESC | |
this | |
} | |
QueryBuilder limit(int limit){ | |
this.limit = limit | |
this | |
} | |
QueryBuilder offset(int offset){ | |
this.offset = offset | |
this | |
} | |
QueryBuilder where(String spreadSheetQuery){ | |
this.query = spreadSheetQuery | |
this | |
} | |
QueryBuilder contains(String contains){ | |
this.contains = contains | |
this | |
} | |
OrderBuilder order(By by){ | |
new OrderBuilder(queryBuilder: this) | |
} | |
Worksheet build(GData gdata){ | |
// the magic happens here based on collected properties | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment