mirror of https://github.com/tasks/tasks
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.
31 lines
754 B
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;
|
|
}
|
|
}
|