All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.lang.Order Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
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;
	}
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy