| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (17) --> |
| <title>PropertiesUtil (Apache Log4j API 2.23.1 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.logging.log4j.util, class: PropertiesUtil"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/PropertiesUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" value="search" disabled="disabled"> |
| <input type="reset" id="reset-button" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.logging.log4j.util</a></div> |
| <h1 title="Class PropertiesUtil" class="title">Class PropertiesUtil</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> |
| <div class="inheritance">org.apache.logging.log4j.util.PropertiesUtil</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">PropertiesUtil</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div> |
| <div class="block"><em>Consider this class private.</em> |
| <p> |
| Provides utility methods for managing <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link"><code>Properties</code></a> instances as well as access to the global configuration |
| system. Properties by default are loaded from the system properties, system environment, and a classpath resource |
| file named "log4j2.component.properties". Additional properties can be loaded by implementing a custom |
| <a href="PropertySource.html" title="interface in org.apache.logging.log4j.util"><code>PropertySource</code></a> service and specifying it via a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html" title="class or interface in java.util" class="external-link"><code>ServiceLoader</code></a> file called |
| <code>META-INF/services/org.apache.logging.log4j.util.PropertySource</code> with a list of fully qualified class names |
| implementing that interface. |
| </p></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="PropertySource.html" title="interface in org.apache.logging.log4j.util"><code>PropertySource</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String)" class="member-name-link">PropertiesUtil</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertiesFileName)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Constructs a PropertiesUtil for a given properties file name on the classpath.</div> |
| </div> |
| <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(java.util.Properties)" class="member-name-link">PropertiesUtil</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> props)</code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Constructs a PropertiesUtil using a given Properties object as its source of defined properties.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addPropertySource(org.apache.logging.log4j.util.PropertySource)" class="member-name-link">addPropertySource</a><wbr>(<a href="PropertySource.html" title="interface in org.apache.logging.log4j.util">PropertySource</a> propertySource)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Allows a PropertySource to be added after PropertiesUtil has been created.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#extractSubset(java.util.Properties,java.lang.String)" class="member-name-link">extractSubset</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> prefix)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties |
| object with the prefix removed.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBooleanProperty(java.lang.String)" class="member-name-link">getBooleanProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBooleanProperty(java.lang.String%5B%5D,java.lang.String,org.apache.logging.log4j.util.Supplier)" class="member-name-link">getBooleanProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a>> supplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBooleanProperty(java.lang.String,boolean)" class="member-name-link">getBooleanProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| boolean defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBooleanProperty(java.lang.String,boolean,boolean)" class="member-name-link">getBooleanProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| boolean defaultValueIfAbsent, |
| boolean defaultValueIfPresent)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a boolean value.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCharsetProperty(java.lang.String)" class="member-name-link">getCharsetProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a Charset value.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCharsetProperty(java.lang.String,java.nio.charset.Charset)" class="member-name-link">getCharsetProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a> defaultValue)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a Charset value.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDoubleProperty(java.lang.String,double)" class="member-name-link">getDoubleProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| double defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a double.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDurationProperty(java.lang.String%5B%5D,java.lang.String,org.apache.logging.log4j.util.Supplier)" class="member-name-link">getDurationProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>> supplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDurationProperty(java.lang.String,java.time.Duration)" class="member-name-link">getDurationProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a> defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a Duration where the String is of the format nnn[unit] where nnn represents an integer value |
| and unit represents a time unit.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getIntegerProperty(java.lang.String%5B%5D,java.lang.String,org.apache.logging.log4j.util.Supplier)" class="member-name-link">getIntegerProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> supplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getIntegerProperty(java.lang.String,int)" class="member-name-link">getIntegerProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| int defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as an integer.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLongProperty(java.lang.String%5B%5D,java.lang.String,org.apache.logging.log4j.util.Supplier)" class="member-name-link">getLongProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a>> supplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLongProperty(java.lang.String,long)" class="member-name-link">getLongProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| long defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a long.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="PropertiesUtil.html" title="class in org.apache.logging.log4j.util">PropertiesUtil</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getProperties()" class="member-name-link">getProperties</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Returns the PropertiesUtil used by Log4j.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStringProperty(java.lang.String)" class="member-name-link">getStringProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a String.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStringProperty(java.lang.String%5B%5D,java.lang.String,org.apache.logging.log4j.util.Supplier)" class="member-name-link">getStringProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> supplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStringProperty(java.lang.String,java.lang.String)" class="member-name-link">getStringProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> defaultValue)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Gets the named property as a String.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getSystemProperties()" class="member-name-link">getSystemProperties</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Return the system properties or an empty Properties object if an error occurs.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hasProperty(java.lang.String)" class="member-name-link">hasProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if the specified property is defined, regardless of its value (it may not have a value).</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isOsWindows()" class="member-name-link">isOsWindows</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns true if system properties tell us we are running on Windows.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#partitionOnCommonPrefixes(java.util.Properties)" class="member-name-link">partitionOnCommonPrefixes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#partitionOnCommonPrefixes(java.util.Properties,boolean)" class="member-name-link">partitionOnCommonPrefixes</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties, |
| boolean includeBaseKey)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#reload()" class="member-name-link">reload</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Reloads all properties.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(java.util.Properties)"> |
| <h3>PropertiesUtil</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">PropertiesUtil</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> props)</span></div> |
| <div class="block">Constructs a PropertiesUtil using a given Properties object as its source of defined properties.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>props</code> - the Properties to use by default</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(java.lang.String)"> |
| <h3>PropertiesUtil</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">PropertiesUtil</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertiesFileName)</span></div> |
| <div class="block">Constructs a PropertiesUtil for a given properties file name on the classpath. The properties specified in this |
| file are used by default. If a property is not defined in this file, then the equivalent system property is used.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>propertiesFileName</code> - the location of properties file to load</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getProperties()"> |
| <h3>getProperties</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="PropertiesUtil.html" title="class in org.apache.logging.log4j.util">PropertiesUtil</a></span> <span class="element-name">getProperties</span>()</div> |
| <div class="block">Returns the PropertiesUtil used by Log4j.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the main Log4j PropertiesUtil instance.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="addPropertySource(org.apache.logging.log4j.util.PropertySource)"> |
| <h3>addPropertySource</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addPropertySource</span><wbr><span class="parameters">(<a href="PropertySource.html" title="interface in org.apache.logging.log4j.util">PropertySource</a> propertySource)</span></div> |
| <div class="block">Allows a PropertySource to be added after PropertiesUtil has been created.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>propertySource</code> - the PropertySource to add.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="hasProperty(java.lang.String)"> |
| <h3>hasProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">hasProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> |
| <div class="block">Returns <code>true</code> if the specified property is defined, regardless of its value (it may not have a value).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to verify</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the specified property is defined, regardless of its value</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getBooleanProperty(java.lang.String)"> |
| <h3>getBooleanProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">getBooleanProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> |
| <div class="block">Gets the named property as a boolean value. If the property matches the string <code>"true"</code> (case-insensitive), |
| then it is returned as the boolean value <code>true</code>. Any other non-<code>null</code> text in the property is |
| considered <code>false</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt>Returns:</dt> |
| <dd>the boolean value of the property or <code>false</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getBooleanProperty(java.lang.String,boolean)"> |
| <h3>getBooleanProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">getBooleanProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| boolean defaultValue)</span></div> |
| <div class="block">Gets the named property as a boolean value.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the boolean value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getBooleanProperty(java.lang.String,boolean,boolean)"> |
| <h3>getBooleanProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">getBooleanProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| boolean defaultValueIfAbsent, |
| boolean defaultValueIfPresent)</span></div> |
| <div class="block">Gets the named property as a boolean value.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValueIfAbsent</code> - the default value to use if the property is undefined</dd> |
| <dd><code>defaultValueIfPresent</code> - the default value to use if the property is defined but not assigned</dd> |
| <dt>Returns:</dt> |
| <dd>the boolean value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getBooleanProperty(java.lang.String[],java.lang.String,org.apache.logging.log4j.util.Supplier)"> |
| <h3>getBooleanProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></span> <span class="element-name">getBooleanProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a>> supplier)</span></div> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt>Returns:</dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCharsetProperty(java.lang.String)"> |
| <h3>getCharsetProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a></span> <span class="element-name">getCharsetProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> |
| <div class="block">Gets the named property as a Charset value.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt>Returns:</dt> |
| <dd>the Charset value of the property or <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html#defaultCharset--" title="class or interface in java.nio.charset" class="external-link"><code>Charset.defaultCharset()</code></a> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCharsetProperty(java.lang.String,java.nio.charset.Charset)"> |
| <h3>getCharsetProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a></span> <span class="element-name">getCharsetProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a> defaultValue)</span></div> |
| <div class="block">Gets the named property as a Charset value. If we cannot find the named Charset, see if it is mapped in |
| file <code>Log4j-charsets.properties</code> on the class path.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the Charset value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDoubleProperty(java.lang.String,double)"> |
| <h3>getDoubleProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double</span> <span class="element-name">getDoubleProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| double defaultValue)</span></div> |
| <div class="block">Gets the named property as a double.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the parsed double value of the property or <code>defaultValue</code> if it was undefined or could not be parsed.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getIntegerProperty(java.lang.String,int)"> |
| <h3>getIntegerProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getIntegerProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| int defaultValue)</span></div> |
| <div class="block">Gets the named property as an integer.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the parsed integer value of the property or <code>defaultValue</code> if it was undefined or could not be |
| parsed.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getIntegerProperty(java.lang.String[],java.lang.String,org.apache.logging.log4j.util.Supplier)"> |
| <h3>getIntegerProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a></span> <span class="element-name">getIntegerProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> supplier)</span></div> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt>Returns:</dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getLongProperty(java.lang.String,long)"> |
| <h3>getLongProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">long</span> <span class="element-name">getLongProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| long defaultValue)</span></div> |
| <div class="block">Gets the named property as a long.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the parsed long value of the property or <code>defaultValue</code> if it was undefined or could not be parsed.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getLongProperty(java.lang.String[],java.lang.String,org.apache.logging.log4j.util.Supplier)"> |
| <h3>getLongProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a></span> <span class="element-name">getLongProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a>> supplier)</span></div> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt>Returns:</dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDurationProperty(java.lang.String,java.time.Duration)"> |
| <h3>getDurationProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a></span> <span class="element-name">getDurationProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a> defaultValue)</span></div> |
| <div class="block">Retrieves a Duration where the String is of the format nnn[unit] where nnn represents an integer value |
| and unit represents a time unit.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - The property name.</dd> |
| <dd><code>defaultValue</code> - The default value.</dd> |
| <dt>Returns:</dt> |
| <dd>The value of the String as a Duration or the default value, which may be null.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDurationProperty(java.lang.String[],java.lang.String,org.apache.logging.log4j.util.Supplier)"> |
| <h3>getDurationProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a></span> <span class="element-name">getDurationProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html" title="class or interface in java.time" class="external-link">Duration</a>> supplier)</span></div> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt>Returns:</dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStringProperty(java.lang.String[],java.lang.String,org.apache.logging.log4j.util.Supplier)"> |
| <h3>getStringProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getStringProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] prefixes, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> key, |
| <a href="Supplier.html" title="interface in org.apache.logging.log4j.util">Supplier</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> supplier)</span></div> |
| <div class="block">Retrieves a property that may be prefixed by more than one string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>prefixes</code> - The array of prefixes.</dd> |
| <dd><code>key</code> - The key to locate.</dd> |
| <dd><code>supplier</code> - The method to call to derive the default value. If the value is null, null will be returned |
| if no property is found.</dd> |
| <dt>Returns:</dt> |
| <dd>The value or null if it is not found.</dd> |
| <dt>Since:</dt> |
| <dd>2.13.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStringProperty(java.lang.String)"> |
| <h3>getStringProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getStringProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div> |
| <div class="block">Gets the named property as a String.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dt>Returns:</dt> |
| <dd>the String value of the property or <code>null</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getStringProperty(java.lang.String,java.lang.String)"> |
| <h3>getStringProperty</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getStringProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> defaultValue)</span></div> |
| <div class="block">Gets the named property as a String.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>name</code> - the name of the property to look up</dd> |
| <dd><code>defaultValue</code> - the default value to use if the property is undefined</dd> |
| <dt>Returns:</dt> |
| <dd>the String value of the property or <code>defaultValue</code> if undefined.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getSystemProperties()"> |
| <h3>getSystemProperties</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a></span> <span class="element-name">getSystemProperties</span>()</div> |
| <div class="block">Return the system properties or an empty Properties object if an error occurs.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>The system properties.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="reload()"> |
| <h3>reload</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">reload</span>()</div> |
| <div class="block">Reloads all properties. This is primarily useful for unit tests.</div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>2.10.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="extractSubset(java.util.Properties,java.lang.String)"> |
| <h3>extractSubset</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a></span> <span class="element-name">extractSubset</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> prefix)</span></div> |
| <div class="block">Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties |
| object with the prefix removed.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>properties</code> - The Properties to evaluate.</dd> |
| <dd><code>prefix</code> - The prefix to extract.</dd> |
| <dt>Returns:</dt> |
| <dd>The subset of properties.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="partitionOnCommonPrefixes(java.util.Properties)"> |
| <h3>partitionOnCommonPrefixes</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>></span> <span class="element-name">partitionOnCommonPrefixes</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties)</span></div> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>properties</code> - properties to partition</dd> |
| <dt>Returns:</dt> |
| <dd>the partitioned properties where each key is the common prefix (minus the period) and the values are |
| new property maps without the prefix and period in the key</dd> |
| <dt>Since:</dt> |
| <dd>2.6</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="partitionOnCommonPrefixes(java.util.Properties,boolean)"> |
| <h3>partitionOnCommonPrefixes</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a>></span> <span class="element-name">partitionOnCommonPrefixes</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html" title="class or interface in java.util" class="external-link">Properties</a> properties, |
| boolean includeBaseKey)</span></div> |
| <div class="block">Partitions a properties map based on common key prefixes up to the first period.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>properties</code> - properties to partition</dd> |
| <dd><code>includeBaseKey</code> - when true if a key exists with no '.' the key will be included.</dd> |
| <dt>Returns:</dt> |
| <dd>the partitioned properties where each key is the common prefix (minus the period) and the values are |
| new property maps without the prefix and period in the key</dd> |
| <dt>Since:</dt> |
| <dd>2.17.2</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isOsWindows()"> |
| <h3>isOsWindows</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isOsWindows</span>()</div> |
| <div class="block">Returns true if system properties tell us we are running on Windows.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>true if system properties tell us we are running on Windows.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small><p align="center"> Copyright © 1999-2024 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.<br/> 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. </p></small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |