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

fun.langel.cql.enums.Order Maven / Gradle / Ivy

The newest version!
package fun.langel.cql.enums;

import fun.langel.cql.util.StringUtil;

/**
 * @author [email protected](GuHan)
 * @since 2022/8/1 20:38
 **/
public enum Order {

    NONE("none"),

    ASC("asc"),

    DESC("desc");

    private String v;

    Order(final String v) {
        this.v = v;
    }

    public String value() {
        return this.v;
    }

    public static Order of(final String v) {
        if (StringUtil.isEmpty(v)) {
            return DESC;
        }
        for (Order o : values()) {
            if (o.value().equalsIgnoreCase(v)) {
                return o;
            }
        }
        return DESC;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy