protected Comparator<O> getComparator(final String sortProperty, final boolean ascending) { return new MyBeanComparator<O>(sortProperty, ascending); }
if (checkAnnotation(BeanHelper.getDeclaredAnnotations(o1.getClass(), prop), StringAlphanumericSort.class) && checkAnnotation(BeanHelper.getDeclaredAnnotations(o2.getClass(), prop), StringAlphanumericSort.class)) { AlphanumericComparator alphanumericComparator = new AlphanumericComparator(ThreadLocalUserContext.getLocale()); if (asc) {
@Override public Iterator<? extends AddressDO> iterator(final long first, final long count) { final SortParam sp = getSort(); if (addresses == null) { return null; } final Comparator<AddressDO> comp = new MyBeanComparator<AddressDO>(sp.getProperty().toString(), sp.isAscending()); Collections.sort(addresses, comp); return addresses.subList((int) first, (int) (first + count)).iterator(); }
@Override public Iterator<TimesheetDO> iterator(final long first, final long count) { final SortParam sp = getSort(); final Comparator<TimesheetDO> comp = new MyBeanComparator<TimesheetDO>(sp.getProperty().toString(), sp.isAscending()); Collections.sort(timesheets, comp); return timesheets.subList((int) first, (int) (first + count)).iterator(); }
protected Comparator<T> getComparator(final SortParam<String> sortParam, final SortParam<String> secondSortParam) { final String sortProperty = sortParam != null ? sortParam.getProperty() : null; final boolean ascending = sortParam != null ? sortParam.isAscending() : true; if (sortProperty != null && sortProperty.startsWith("attr:")) { return (Comparator<T>) new AttrComperator(sortProperty, ascending); } final String secondSortProperty = secondSortParam != null ? secondSortParam.getProperty() : null; final boolean secondAscending = secondSortParam != null ? secondSortParam.isAscending() : true; return new MyBeanComparator<T>(sortProperty, ascending, secondSortProperty, secondAscending); }
protected Comparator<VacationDO> getComparator(final SortParam<String> sortParam, final SortParam<String> secondSortParam) { final String sortProperty = sortParam != null ? sortParam.getProperty() : null; final boolean ascending = sortParam != null ? sortParam.isAscending() : true; final String secondSortProperty = secondSortParam != null ? secondSortParam.getProperty() : null; final boolean secondAscending = secondSortParam != null ? secondSortParam.isAscending() : true; return new MyBeanComparator<VacationDO>(sortProperty, ascending, secondSortProperty, secondAscending); }
protected Comparator<T> getComparator(final SortParam<String> sortParam, final SortParam<String> secondSortParam) { final String sortProperty = sortParam != null ? sortParam.getProperty() : null; final boolean ascending = sortParam != null ? sortParam.isAscending() : true; final String secondSortProperty = secondSortParam != null ? secondSortParam.getProperty() : null; final boolean secondAscending = secondSortParam != null ? secondSortParam.isAscending() : true; return new MyBeanComparator<T>(sortProperty, ascending, secondSortProperty, secondAscending); }
protected Comparator<FFPAccountingDO> getComparator(final SortParam<String> sortParam, final SortParam<String> secondSortParam) { final String sortProperty = sortParam != null ? sortParam.getProperty() : null; final boolean ascending = sortParam != null ? sortParam.isAscending() : true; final String secondSortProperty = secondSortParam != null ? secondSortParam.getProperty() : null; final boolean secondAscending = secondSortParam != null ? secondSortParam.isAscending() : true; return new MyBeanComparator<FFPAccountingDO>(sortProperty, ascending, secondSortProperty, secondAscending); }