@Override public PropertyRestriction getPropertyRestriction(String propertyName) { List<PropertyRestriction> list = propertyRestrictions.get(propertyName); if (list.isEmpty()) { return null; } else if (list.size() == 1) { return list.get(0); } int bestSort = -1; PropertyRestriction best = null; for (PropertyRestriction x : list) { int sort = x.sortOrder(); if (sort > bestSort) { bestSort = sort; best = x; } } return best; }
@Override public PropertyRestriction getPropertyRestriction(String propertyName) { List<PropertyRestriction> list = propertyRestrictions.get(propertyName); if (list.isEmpty()) { return null; } else if (list.size() == 1) { return list.get(0); } int bestSort = -1; PropertyRestriction best = null; for (PropertyRestriction x : list) { int sort = x.sortOrder(); if (sort > bestSort) { bestSort = sort; best = x; } } return best; }
@Override public PropertyRestriction getPropertyRestriction(String propertyName) { List<PropertyRestriction> list = propertyRestrictions.get(propertyName); if (list.isEmpty()) { return null; } else if (list.size() == 1) { return list.get(0); } int bestSort = -1; PropertyRestriction best = null; for (PropertyRestriction x : list) { int sort = x.sortOrder(); if (sort > bestSort) { bestSort = sort; best = x; } } return best; }