Package com.tonic.analysis.query.ast
Class OrderBy
- java.lang.Object
-
- com.tonic.analysis.query.ast.OrderBy
-
public final class OrderBy extends Object
Ordering clause for query results: a sort key and a direction.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OrderByasc(String key)Creates an ascending ordering.booleanascending()static OrderBydesc(String key)Creates a descending ordering.booleanequals(Object o)inthashCode()Stringkey()StringtoString()
-
-
-
Constructor Detail
-
OrderBy
public OrderBy(String key, boolean ascending)
Creates an ordering clause.- Parameters:
key- the attribute name to sort byascending- whether results sort in ascending order
-
-
Method Detail
-
key
public String key()
- Returns:
- the sort key attribute name
-
ascending
public boolean ascending()
- Returns:
- whether results sort in ascending order
-
asc
public static OrderBy asc(String key)
Creates an ascending ordering.- Parameters:
key- the attribute name to sort by- Returns:
- the ascending clause
-
desc
public static OrderBy desc(String key)
Creates a descending ordering.- Parameters:
key- the attribute name to sort by- Returns:
- the descending clause
-
-