You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tasks/astrid/common-src/com/todoroo/andlib/data/sql/Order.java

31 lines
754 B
Java

package com.todoroo.andlib.data.sql;
import static com.todoroo.andlib.data.sql.Constants.SPACE;
public class Order {
private final Field expression;
private final OrderType orderType;
private Order(Field expression) {
this(expression, OrderType.ASC);
}
private Order(Field expression, OrderType orderType) {
this.expression = expression;
this.orderType = orderType;
}
public static Order asc(Field expression) {
return new Order(expression);
}
public static Order desc(Field expression) {
return new Order(expression, OrderType.DESC);
}
@Override
public String toString() {
return expression + SPACE + orderType;
}
}