panda.lang.Order Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.lang;
/**
*/
public enum Order {
/**
* ASC = "ASC";
*/
ASC,
/**
* DESC = "DESC";
*/
DESC;
public static Order parse(String order) {
if (Strings.isNotEmpty(order)) {
char c = Character.toLowerCase(order.charAt(0));
if (c == 'd') {
return DESC;
}
}
return ASC;
}
public static Order reverse(Order order) {
return order == ASC ? DESC : ASC;
}
}