Class EntityValuesComparator<T>

java.lang.Object
io.jmix.ui.model.impl.AbstractComparator<T>
io.jmix.ui.model.impl.EntityValuesComparator<T>
All Implemented Interfaces:
Comparator<T>

public class EntityValuesComparator<T> extends AbstractComparator<T>
A comparison function, which imposes a ordering for entity attribute values.

For example, to obtain a Comparator that compares io.jmix.core.Entity objects by some property that is specified by io.jmix.core.metamodel.model.MetaPropertyPath:

Comparator.comparing(e -> e.getValueEx(propertyPath), EntityValuesComparator.of(asc))
  • Constructor Details

    • EntityValuesComparator

      public EntityValuesComparator(boolean asc, MetaClass metaClass, org.springframework.beans.factory.BeanFactory beanFactory)
  • Method Details

    • compare

      public int compare(T o1, T o2)
    • transformValue

      @Nullable protected Object transformValue(@Nullable T value)