Class OverrideProperties
- java.lang.Object
-
- com.macrofocus.properties.implementation.AbstractProperties<java.lang.String>
-
- com.macrofocus.properties.implementation.OverrideProperties
-
- All Implemented Interfaces:
MutableProperties<java.lang.String>
,Properties<java.lang.String>
,java.lang.Iterable<java.lang.String>
public class OverrideProperties extends AbstractProperties<java.lang.String> implements MutableProperties<java.lang.String>
Default data model for a collection of properties.
-
-
Constructor Summary
Constructors Constructor Description OverrideProperties(MutableProperties<java.lang.String> defaults, MutableProperty<java.lang.Boolean> overrideDefaults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> MutableProperty<T>
addProperty(java.lang.String name, MutableProperty<T> property)
protected OverrideProperty
createProperty(java.lang.String name, MutableProperty<java.lang.Boolean> overrideDefaults, MutableProperty defaultProperty)
<T> MutableProperty<T>
createProperty(java.lang.String name, T value)
OverrideProperty
getProperty(java.lang.String name)
java.lang.Object
getValue(java.lang.String name)
boolean
isOverrideDefaults()
Gets whether the default settings are overridden by these settingsjava.util.Iterator<java.lang.String>
iterator()
protected void
registerPropertyListener(java.lang.String name, MutableProperty property)
<T> MutableProperty<T>
replaceProperty(java.lang.String name, MutableProperty<T> property)
void
reset()
void
setOverrideDefaults(boolean overrideDefaults)
Sets whether the default settings should be overridden by these settingsvoid
setValue(java.lang.String name, java.lang.Object value)
-
Methods inherited from class com.macrofocus.properties.implementation.AbstractProperties
addPropertiesListener, addWeakPropertiesListener, notifyPropertyChanged, removePropertiesListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.properties.Properties
addPropertiesListener, addWeakPropertiesListener, removePropertiesListener
-
-
-
-
Constructor Detail
-
OverrideProperties
public OverrideProperties(MutableProperties<java.lang.String> defaults, MutableProperty<java.lang.Boolean> overrideDefaults)
-
-
Method Detail
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.String>
-
isOverrideDefaults
public boolean isOverrideDefaults()
Gets whether the default settings are overridden by these settings- Returns:
- true if this override the default settings, false otherwise
-
setOverrideDefaults
public void setOverrideDefaults(boolean overrideDefaults)
Sets whether the default settings should be overridden by these settings- Parameters:
overrideDefaults
- true to override the default settings, false otherwise
-
createProperty
public <T> MutableProperty<T> createProperty(java.lang.String name, T value)
- Specified by:
createProperty
in interfaceMutableProperties<java.lang.String>
-
addProperty
public <T> MutableProperty<T> addProperty(java.lang.String name, MutableProperty<T> property)
- Specified by:
addProperty
in interfaceMutableProperties<java.lang.String>
-
replaceProperty
public <T> MutableProperty<T> replaceProperty(java.lang.String name, MutableProperty<T> property)
- Specified by:
replaceProperty
in interfaceMutableProperties<java.lang.String>
-
getValue
public java.lang.Object getValue(java.lang.String name)
- Specified by:
getValue
in interfaceProperties<java.lang.String>
-
setValue
public void setValue(java.lang.String name, java.lang.Object value)
- Specified by:
setValue
in interfaceMutableProperties<java.lang.String>
-
getProperty
public OverrideProperty getProperty(java.lang.String name)
- Specified by:
getProperty
in interfaceMutableProperties<java.lang.String>
- Specified by:
getProperty
in interfaceProperties<java.lang.String>
-
registerPropertyListener
protected void registerPropertyListener(java.lang.String name, MutableProperty property)
-
createProperty
protected OverrideProperty createProperty(java.lang.String name, MutableProperty<java.lang.Boolean> overrideDefaults, MutableProperty defaultProperty)
-
reset
public void reset()
-
-