Package net.sf.basedb.core
Class Presets.Preset
- java.lang.Object
-
- net.sf.basedb.core.Presets.Preset
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
buildDom(Element element)
Add XML elements to the parent element for this preset's key-value pairs.List<String>
getKeys()
Get all keys in this preset.String
getName()
Get the name of this preset.String
getSetting(String name)
Get the value for the setting with the specified name.Iterator<Map.Entry<String,String>>
iterator()
Iterate over all settings.void
setSetting(String name, String value)
Set a value for the specified setting.int
size()
Get the number of settings in the preset.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
buildDom
private void buildDom(Element element)
Add XML elements to the parent element for this preset's key-value pairs. The parent element is either a <preset> or a <default> element.- Parameters:
element
- The parent element to add this preset to
-
getName
public String getName()
Get the name of this preset.- Returns:
- The name, or null if this is the default preset
-
getSetting
public String getSetting(String name)
Get the value for the setting with the specified name.- Parameters:
name
- The name of the setting- Returns:
- The value or null if no value exists
-
setSetting
public void setSetting(String name, String value)
Set a value for the specified setting.- Parameters:
name
- The name of the settingvalue
- The value, use null to remove the setting
-
size
public int size()
Get the number of settings in the preset.- Since:
- 3.4
-
-