Class Settings


  • public final class Settings
    extends Object
    Settings

    This a type-enabled wrapper for a Properties object

    • Constructor Detail

      • Settings

        public Settings()
        Constructor
      • Settings

        public Settings​(Properties settings)
        Constructor
    • Method Detail

      • readFrom

        public void readFrom​(File settingsFile)
                      throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • writeTo

        public void writeTo​(File settingsFile,
                            String title)
                     throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getStringProperty

        public String getStringProperty​(String key)
        Get a property by name
        Parameters:
        key - the property name
      • getStringProperty

        public String getStringProperty​(String key,
                                        String defaultValue)
        Get a property by name
        Parameters:
        key - the property name
      • getStringProperty

        public String getStringProperty​(String key,
                                        String defaultValue,
                                        boolean replaceSystemProperties)
        Get a property by name
        Parameters:
        key - the property name
      • getIntProperty

        public int getIntProperty​(String key,
                                  int defaultValue)
        Get a property by name
        Parameters:
        key - the property name
      • getLongProperty

        public long getLongProperty​(String key,
                                    long defaultValue)
        Get a property by name
        Parameters:
        key - the property name
      • getBooleanProperty

        public boolean getBooleanProperty​(String key,
                                          boolean defaultValue)
        Get a property by name
        Parameters:
        key - the property name
      • setStringProperty

        public void setStringProperty​(String key,
                                      String value)
        Set a string property by name
        Parameters:
        key - the property name
      • setIntProperty

        public void setIntProperty​(String key,
                                   int value)
        Set a string property by name
        Parameters:
        key - the property name
      • setLongProperty

        public void setLongProperty​(String key,
                                    long value)
        Set a string property by name
        Parameters:
        key - the property name
      • setBooleanProperty

        public void setBooleanProperty​(String key,
                                       boolean value)
        Set a string property by name
        Parameters:
        key - the property name
      • removeProperty

        public String removeProperty​(String key)
        Remove a property from this settings object
        Parameters:
        key - the property name
        Returns:
        the value of the removed property or null if not found
      • asProperties

        public Properties asProperties()
        Utility method to access the settings object as a properties object
        Returns:
        the underlying properties object
      • keySet

        public Set<Object> keySet()
        Return a set of the settings keys
        Returns:
        a set of the settings keys