Class PropertyUtils
- java.lang.Object
-
- org.owasp.csrfguard.config.properties.PropertyUtils
-
public final class PropertyUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcommonSubstitutions(String input)Replaces percent-bounded expressions such as "%servletContext%." common substitutions in config valuesstatic StringgetProperty(Properties properties, String propertyName)property string and substitutionsstatic StringgetProperty(Properties properties, String propertyName, String defaultValue)property string and substitutionsstatic <T> TgetProperty(Properties properties, String propertyName, T defaultValue, Function<String,T> function)static StringgetProperty(Properties properties, org.apache.commons.lang3.tuple.Pair<String,String> propertyWithDefaultValue)static booleangetProperty(Properties properties, SimpleBooleanConfigParameter configParameter)static <T> TgetProperty(Properties properties, SimpleConfigParameter<T> configParameter, Function<String,T> function)static DurationgetProperty(Properties properties, SimpleDurationParameter configParameter)static intgetProperty(Properties properties, SimpleIntConfigParameter configParameter)
-
-
-
Method Detail
-
getProperty
public static String getProperty(Properties properties, String propertyName)
property string and substitutions- Parameters:
properties- The properties from which to fetch a valuepropertyName- The name of the desired property- Returns:
- the value, with common substitutions performed
- See Also:
commonSubstitutions(String)
-
getProperty
public static String getProperty(Properties properties, org.apache.commons.lang3.tuple.Pair<String,String> propertyWithDefaultValue)
-
getProperty
public static int getProperty(Properties properties, SimpleIntConfigParameter configParameter)
-
getProperty
public static boolean getProperty(Properties properties, SimpleBooleanConfigParameter configParameter)
-
getProperty
public static <T> T getProperty(Properties properties, SimpleConfigParameter<T> configParameter, Function<String,T> function)
-
getProperty
public static Duration getProperty(Properties properties, SimpleDurationParameter configParameter)
-
getProperty
public static <T> T getProperty(Properties properties, String propertyName, T defaultValue, Function<String,T> function)
-
getProperty
public static String getProperty(Properties properties, String propertyName, String defaultValue)
property string and substitutions- Parameters:
properties- The properties from which to fetch a valuepropertyName- The name of the desired propertydefaultValue- The value to use when the propertyName does not exist- Returns:
- the value, with common substitutions performed
- See Also:
commonSubstitutions(String)
-
commonSubstitutions
public static String commonSubstitutions(String input)
Replaces percent-bounded expressions such as "%servletContext%." common substitutions in config values- Parameters:
input- A string with expressions that should be replaced- Returns:
- new string with "common" expressions replaced by configuration values
-
-