Package net.sf.basedb.core
Class Presets.Preset
java.lang.Object
net.sf.basedb.core.Presets.Preset
- Enclosing class:
- Presets
Represents a single preset. A preset contains any number of key-value
pairs (string). A named preset has a non-null name.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Add XML elements to the parent element for this preset's key-value pairs.getKeys()
Get all keys in this preset.getName()
Get the name of this preset.getSetting
(String name) Get the value for the setting with the specified name.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
-
Field Details
-
settings
The key-value pairs in this preset. -
name
The name of this preset. Null for the default.
-
-
Constructor Details
-
Preset
private Preset() -
Preset
-
Preset
Load preset name and key-value pairs from XML Document.
-
-
Method Details
-
iterator
Iterate over all settings. -
buildDom
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
Get the name of this preset.- Returns:
- The name, or null if this is the default preset
-
getSetting
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
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
-
getKeys
Get all keys in this preset. The returned list is a copy of the settings and are not affected by later additions or removals.
-