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
749 B
Java
31 lines
749 B
Java
15 years ago
|
package com.todoroo.andlib.sql;
|
||
15 years ago
|
|
||
15 years ago
|
import static com.todoroo.andlib.sql.Constants.SPACE;
|
||
15 years ago
|
|
||
|
public class Order {
|
||
15 years ago
|
private final Object expression;
|
||
15 years ago
|
private final OrderType orderType;
|
||
|
|
||
15 years ago
|
private Order(Object expression) {
|
||
15 years ago
|
this(expression, OrderType.ASC);
|
||
|
}
|
||
|
|
||
15 years ago
|
private Order(Object expression, OrderType orderType) {
|
||
15 years ago
|
this.expression = expression;
|
||
|
this.orderType = orderType;
|
||
|
}
|
||
|
|
||
15 years ago
|
public static Order asc(Object expression) {
|
||
15 years ago
|
return new Order(expression);
|
||
|
}
|
||
|
|
||
15 years ago
|
public static Order desc(Object expression) {
|
||
15 years ago
|
return new Order(expression, OrderType.DESC);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String toString() {
|
||
|
return expression + SPACE + orderType;
|
||
|
}
|
||
|
}
|