Example usage for com.liferay.portal.kernel.util.comparator PasswordPolicyDescriptionComparator PasswordPolicyDescriptionComparator

List of usage examples for com.liferay.portal.kernel.util.comparator PasswordPolicyDescriptionComparator PasswordPolicyDescriptionComparator

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util.comparator PasswordPolicyDescriptionComparator PasswordPolicyDescriptionComparator.

Prototype

public PasswordPolicyDescriptionComparator(boolean ascending) 

Source Link

Usage

From source file:com.liferay.password.policies.admin.web.internal.search.PasswordPolicySearch.java

License:Open Source License

protected OrderByComparator<PasswordPolicy> getOrderByComparator(String orderByCol, String orderByType) {

    boolean orderByAsc = false;

    if (orderByType.equals("asc")) {
        orderByAsc = true;/*from   ww w. ja v a2 s .c o m*/
    }

    OrderByComparator<PasswordPolicy> orderByComparator = null;

    if (orderByCol.equals("name")) {
        orderByComparator = new PasswordPolicyNameComparator(orderByAsc);
    } else if (orderByCol.equals("description")) {
        orderByComparator = new PasswordPolicyDescriptionComparator(orderByAsc);
    } else {
        orderByComparator = new PasswordPolicyNameComparator(orderByAsc);
    }

    return orderByComparator;
}