use of de.alpharogroup.comparators.NullCheckComparator in project bundle-app-ui by astrapi69.
the class OverviewResourceBundleAddEntryPanel method reloadTableModelList.
private void reloadTableModelList() {
tableModelList = new ArrayList<>();
final ResourcebundlesService resourcebundlesService = SpringApplicationContext.getInstance().getResourcebundlesService();
BundleApplications bundleApplication = getModelObject().getBundleApplication();
final String baseName = getModelObject().getSelectedBundleName().getBaseName().getName();
final Locale locale = LocaleResolver.resolveLocale(getModelObject().getSelectedBundleName().getLocale().getLocale());
final List<Resourcebundles> list = resourcebundlesService.findResourceBundles(bundleApplication, baseName, locale);
for (final Resourcebundles resourcebundle : list) {
tableModelList.add(Quattro.<String, String, Resourcebundles, Resourcebundles>builder().topLeft(resourcebundle.getKey().getName()).topRight(resourcebundle.getValue()).bottomLeft(resourcebundle).bottomRight(resourcebundle).build());
}
Collections.sort(tableModelList, NullCheckComparator.<Quattro<String, String, Resourcebundles, Resourcebundles>>of((o1, o2) -> o1.getTopLeft().compareTo(o2.getTopLeft())));
}
use of de.alpharogroup.comparators.NullCheckComparator in project bundle-app-ui by astrapi69.
the class OverviewOfAllResourceBundlesPanel method getTableModelList.
private List<Triple<String, String, BundleNames>> getTableModelList() {
if (tableModelList == null) {
tableModelList = new ArrayList<>();
BundleApplications bundleApplication = getModelObject().getBundleApplication();
getModelObject().setBundleNames(SpringApplicationContext.getInstance().getBundleApplicationsService().find(bundleApplication));
final Set<BundleNames> set = getModelObject().getBundleNames();
if (CollectionExtensions.isNotEmpty(set)) {
for (final BundleNames bundleNames : set) {
tableModelList.add(Triple.<String, String, BundleNames>builder().left(bundleNames.getBaseName().getName()).middle(bundleNames.getLocale().getLocale()).right(bundleNames).build());
}
}
Collections.sort(tableModelList, NullCheckComparator.<Triple<String, String, BundleNames>>of((o1, o2) -> o1.getLeft().compareTo(o2.getLeft())));
}
return tableModelList;
}
Aggregations