Class Presets.Preset

    • Field Detail

      • settings

        private Map<String,​String> settings
        The key-value pairs in this preset.
      • name

        private String name
        The name of this preset. Null for the default.
    • Constructor Detail

      • Preset

        private Preset()
      • Preset

        private Preset​(String name)
      • Preset

        private Preset​(Element preset)
        Load preset name and key-value pairs from XML Document.
    • 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 setting
        value - The value, use null to remove the setting
      • size

        public int size()
        Get the number of settings in the preset.
        Since:
        3.4
      • getKeys

        public List<String> 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.