/** * Retrieve property definitions for properties that are not in a group. The list is sorted by property definition * order index, then by name. * * <p/>DO NOT use this for updating the collection, as the updates will not be persisted! * * <p/> * * @return the set of properties that are not in a group * * @see #getPropertyDefinitions() */ @NotNull public List<PropertyDefinition> getNonGroupedProperties() { List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(); for (PropertyDefinition propertyDefinition : this.propertyDefinitions.values()) { if (propertyDefinition.getPropertyGroupDefinition() == null) { propertyDefinitions.add(propertyDefinition); } } Collections.sort(propertyDefinitions, new PropertyDefinitionComparator()); return propertyDefinitions; }
/** * Retrieve property definitions for properties in a group with the provided name. The list is sorted by property * definition order index, then by name. * * <p/>NOTE: updates of the result List will not be reflected in the database! * * @param groupName the name of the group * * @return the set of properties in a group with the provided name */ @NotNull public List<PropertyDefinition> getPropertiesInGroup(String groupName) { List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(); for (PropertyDefinition propertyDefinition : this.propertyDefinitions.values()) { PropertyGroupDefinition group = propertyDefinition.getPropertyGroupDefinition(); if ((group != null) && group.getName().equals(groupName)) { propertyDefinitions.add(propertyDefinition); } } Collections.sort(propertyDefinitions, new PropertyDefinitionComparator()); return propertyDefinitions; }