Class PropertyListImpl
java.lang.Object
net.officefloor.compile.impl.properties.PropertyListImpl
- All Implemented Interfaces:
Iterable<Property>,PropertyList
Implementation of the
PropertyList.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(String name) Appends aPropertyto thisPropertyList.addProperty(String name, String label) Appends aPropertyto thisPropertyList.voidclear()Clears thePropertyList.voidconfigureProperties(PropertyConfigurable configurable) getOrAddProperty(String name) Obtains thePropertiespopulated with thePropertyvalues.getProperty(String name) Obtains the firstPropertyby the input name.String[]Obtains the names of thePropertyinstances in the order they were added.getPropertyValue(String name, String defaultValue) Convenience method to obtain thePropertyvalue.iterator()voidNormalises thePropertyinstances.voidremoveProperty(Property property) Removes thePropertyfrom thisPropertyList.voidsort(Comparator<? super Property> comparator) Enable sorting thePropertyinstances within thisPropertyList.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PropertyListImpl
Initiate.- Parameters:
nameValuePairs-Propertyname/values to initially populate this list.
-
-
Method Details
-
iterator
-
addProperty
Description copied from interface:PropertyListAppends aPropertyto thisPropertyList.- Specified by:
addPropertyin interfacePropertyList- Parameters:
name- Name of theProperty.label- Label of theProperty. Should this be blank it will be defaulted to the name.- Returns:
Propertyadded.
-
addProperty
Description copied from interface:PropertyListAppends aPropertyto thisPropertyList.- Specified by:
addPropertyin interfacePropertyList- Parameters:
name- Name of thePropertywhich is also used as the label.- Returns:
Propertyadded.
-
removeProperty
Description copied from interface:PropertyListRemoves thePropertyfrom thisPropertyList.- Specified by:
removePropertyin interfacePropertyList- Parameters:
property-Propertyto be removed.
-
getPropertyNames
Description copied from interface:PropertyListObtains the names of thePropertyinstances in the order they were added.- Specified by:
getPropertyNamesin interfacePropertyList- Returns:
- Names of the
Propertyinstances.
-
getProperty
Description copied from interface:PropertyListObtains the firstPropertyby the input name.- Specified by:
getPropertyin interfacePropertyList- Parameters:
name- Name of thePropertyto return.- Returns:
- First
Propertyby the input name, ornullif noPropertyby the name.
-
getOrAddProperty
Description copied from interface:PropertyList- Specified by:
getOrAddPropertyin interfacePropertyList- Parameters:
name- Name of thePropertyto return.- Returns:
- First
Propertyby the input name or a newly addedPropertyif noPropertyfound by the name.
-
getPropertyValue
Description copied from interface:PropertyListConvenience method to obtain thePropertyvalue.- Specified by:
getPropertyValuein interfacePropertyList- Parameters:
name- Name of thePropertyto obtain its value.defaultValue- Default value should thePropertynot exist or have blank value.- Returns:
- Value for the
Property(ordefaultValueif not available).
-
getProperties
Description copied from interface:PropertyListObtains thePropertiespopulated with thePropertyvalues.- Specified by:
getPropertiesin interfacePropertyList- Returns:
- Populated
Properties.
-
clear
public void clear()Description copied from interface:PropertyListClears thePropertyList.- Specified by:
clearin interfacePropertyList
-
sort
Description copied from interface:PropertyListEnable sorting thePropertyinstances within thisPropertyList.- Specified by:
sortin interfacePropertyList- Parameters:
comparator-Comparatorto provide comparisons for sorting.
-
normalise
public void normalise()Description copied from interface:PropertyListNormalises the
Propertyinstances.This will remove:
- Specified by:
normalisein interfacePropertyList
-
configureProperties
Description copied from interface:PropertyList- Specified by:
configurePropertiesin interfacePropertyList- Parameters:
configurable-PropertyConfigurableto be configured with thePropertyvalues.
-