Class PropertyAggregator.Builder

    • Constructor Detail

      • Builder

        public Builder​(boolean loggingEnabled)
        Constructor for the Builder.
        Parameters:
        loggingEnabled - If true, logs will be shown.s
    • Method Detail

      • withSystemProperties

        public PropertyAggregator.Builder withSystemProperties()
        Add a system property source to the queue. Each new property source added has a higher priority than the previous one.
        Returns:
        The PropertyAggregator.
      • withEnvironmentProperties

        public PropertyAggregator.Builder withEnvironmentProperties()
        Add an environment property source to the queue. Each new property source added has a higher priority than the previous one.
        Returns:
        The PropertyAggregator.
      • withPropertiesFile

        public PropertyAggregator.Builder withPropertiesFile​(String propertiesFilePath)
        Add a property file source to the queue. This can be added multiple times with different property files.
        Parameters:
        propertiesFilePath - The path to the properties file.
        Returns:
        The PropertyAggregator.
      • withPropertiesFileInClassPath

        public PropertyAggregator.Builder withPropertiesFileInClassPath​(String propertiesFilePath)
        Add a property file source inside the application classpath to the queue. This can be added multiple times with different property files.
        Parameters:
        propertiesFilePath - The path to the properties file in the application classpath.
        Returns:
        The PropertyAggregator.
      • withFilteredKeys

        public PropertyAggregator.Builder withFilteredKeys​(List<String> keys)
        Apply a list of keys to filter the final properties by. All properties whose key does not match any entry will be removed.
        Parameters:
        keys - A list of property keys to filter by.
        Returns:
        The PropertyAggregator.
      • withDefaultValues

        public PropertyAggregator.Builder withDefaultValues​(Map<String,​String> defaultValues)
        Apply a map of keys with their default values. If a property with a default value is not set by any property source, it is added with its default value.
        Parameters:
        defaultValues - A map containing property keys and their default values.
        Returns:
        The PropertyAggregator.