接口 Configuration

    • 方法详细资料

      • getString

        default String getString​(String key)
        Get a string associated with the given configuration key.
        参数:
        key - The configuration key.
        返回:
        The associated string.
      • getString

        default String getString​(String key,
                                 String defaultValue)
        Get a string associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        参数:
        key - The configuration key.
        defaultValue - The default value.
        返回:
        The associated string if key is found and has valid format, default value otherwise.
      • getInt

        default int getInt​(String key)
      • getInt

        default int getInt​(String key,
                           int defaultValue)
      • getBoolean

        default boolean getBoolean​(String key)
      • getBoolean

        default boolean getBoolean​(String key,
                                   boolean defaultValue)
      • getProperty

        default Object getProperty​(String key)
        Gets a property from the configuration. This is the most basic get method for retrieving values of properties. In a typical implementation of the Configuration interface the other get methods (that return specific data types) will internally make use of this method. On this level variable substitution is not yet performed. The returned object is an internal representation of the property value for the passed in key. It is owned by the Configuration object. So a caller should not modify this object. It cannot be guaranteed that this object will stay constant over time (i.e. further update operations on the configuration may change its internal state).
        参数:
        key - property to retrieve
        返回:
        the value to which this configuration maps the specified key, or null if the configuration contains no mapping for this key.
      • getProperty

        default Object getProperty​(String key,
                                   Object defaultValue)
        Gets a property from the configuration. The default value will return if the configuration doesn't contain the mapping for the specified key.
        参数:
        key - property to retrieve
        defaultValue - default value
        返回:
        the value to which this configuration maps the specified key, or default value if the configuration contains no mapping for this key.
      • getInternalProperty

        Object getInternalProperty​(String key)
      • containsKey

        default boolean containsKey​(String key)
        Check if the configuration contains the specified key.
        参数:
        key - the key whose presence in this configuration is to be tested
        返回:
        true if the configuration contains a value for this key, false otherwise
      • convert

        default <T> T convert​(Class<T> cls,
                              String key,
                              T defaultValue)
      • toBooleanObject

        static Boolean toBooleanObject​(boolean bool)