org.apache.logging.log4j.util

Interface PropertySource

    • Method Detail

      • getPriority

        int getPriority()
        Returns the order in which this PropertySource has priority. A higher value means that the source will be searched later and can be overridden by other property sources.
        Returns:
        priority value
      • forEach

        default void forEach(BiConsumer<String,String> action)
        Iterates over all properties and performs an action for each key/value pair.
        Parameters:
        action - action to perform on each key/value pair
      • getPropertyNames

        default Collection<String> getPropertyNames()
        Returns the list of all property names.
        Returns:
        list of property names
      • getNormalForm

        default CharSequence getNormalForm(Iterable<? extends CharSequence> tokens)
        Converts a list of property name tokens into a normal form. For example, a list of tokens such as "foo", "bar", "baz", might be normalized into the property name "log4j2.fooBarBaz".
        Parameters:
        tokens - list of property name tokens
        Returns:
        a normalized property name using the given tokens
      • getProperty

        default String getProperty(String key)
        For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.
        Parameters:
        key - The key to search for.
        Returns:
        The value or null;
        Since:
        2.13.0
      • containsProperty

        default boolean containsProperty(String key)
        For PropertySources that cannot iterate over all the potential properties this provides a direct lookup.
        Parameters:
        key - The key to search for.
        Returns:
        The value or null;
        Since:
        2.13.0

Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.