Example usage for com.liferay.portal.kernel.util OrderByComparatorAdapter OrderByComparatorAdapter

List of usage examples for com.liferay.portal.kernel.util OrderByComparatorAdapter OrderByComparatorAdapter

Introduction

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

Prototype

public OrderByComparatorAdapter(OrderByComparator<V> orderByComparator) 

Source Link

Usage

From source file:com.liferay.petra.model.adapter.util.ModelAdapterUtil.java

License:Open Source License

public static <T, V> OrderByComparator<T> adapt(Class<V> clazz, OrderByComparator<V> orderByComparator) {

    if (orderByComparator == null) {
        return null;
    }// w w w.  j av  a2  s .  c  om

    return new OrderByComparatorAdapter<T, V>(orderByComparator) {

        @Override
        public V adapt(T t) {
            return ModelAdapterUtil.adapt(clazz, t);
        }

    };
}