public class PropertyUtil extends Object
Constructor and Description |
---|
PropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getPropertyOrDefault(Class<?> referenceClass,
String propertyFile,
String key,
String defaultValue)
Get the value of a property or a default value if there's an error retrieving the property key.
|
public static String getPropertyOrDefault(Class<?> referenceClass, String propertyFile, String key, String defaultValue)
referenceClass
- The class which should be used to find the property file. The property
file is expected to be packaged in the same directory as this class.propertyFile
- The name of the property file to be read.key
- The property key to find in the property file.defaultValue
- The value to return if no property with the given key is found or if the
property file cannot be found.Copyright © 2021. All rights reserved.