Class PrefixedConfigurationParameters

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> get​(java.lang.String key)
      Get the configuration parameter stored under the specified key.
      <T> java.util.Optional<T> get​(java.lang.String key, java.util.function.Function<java.lang.String,​T> transformer)
      Get and transform the configuration parameter stored under the specified key using the specified transformer.
      java.util.Optional<java.lang.Boolean> getBoolean​(java.lang.String key)
      Get the boolean configuration parameter stored under the specified key.
      int size()
      Get the number of configuration parameters stored directly in this ConfigurationParameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrefixedConfigurationParameters

        public PrefixedConfigurationParameters​(ConfigurationParameters delegate,
                                               java.lang.String prefix)
        Create a new view of the supplied ConfigurationParameters that applies the supplied prefix to all queries.
        Parameters:
        delegate - the ConfigurationParameters to delegate to; never null
        prefix - the prefix to apply to all queries; never null or blank
    • Method Detail

      • getBoolean

        public java.util.Optional<java.lang.Boolean> getBoolean​(java.lang.String key)
        Description copied from interface: ConfigurationParameters
        Get the boolean configuration parameter stored under the specified key.

        If no such key is present in this ConfigurationParameters, an attempt will be made to look up the value as a JVM system property. If no such system property exists, an attempt will be made to look up the value in the JUnit Platform properties file.

        Specified by:
        getBoolean in interface ConfigurationParameters
        Parameters:
        key - the key to look up; never null or blank
        Returns:
        an Optional containing the value; never null but potentially empty
        See Also:
        ConfigurationParameters.get(String), Boolean.parseBoolean(String), System.getProperty(String), ConfigurationParameters.CONFIG_FILE_NAME
      • get

        public <T> java.util.Optional<T> get​(java.lang.String key,
                                             java.util.function.Function<java.lang.String,​T> transformer)
        Description copied from interface: ConfigurationParameters
        Get and transform the configuration parameter stored under the specified key using the specified transformer.

        If no such key is present in this ConfigurationParameters, an attempt will be made to look up the value as a JVM system property. If no such system property exists, an attempt will be made to look up the value in the JUnit Platform properties file.

        In case the transformer throws an exception, it will be wrapped in a JUnitException with a helpful message.

        Specified by:
        get in interface ConfigurationParameters
        Parameters:
        key - the key to look up; never null or blank
        transformer - the transformer to apply in case a value is found; never null
        Returns:
        an Optional containing the value; never null but potentially empty
        See Also:
        ConfigurationParameters.getBoolean(String), System.getProperty(String), ConfigurationParameters.CONFIG_FILE_NAME