Package com.diozero.util
Class PropertyUtil
- java.lang.Object
-
- com.diozero.util.PropertyUtil
-
public class PropertyUtil extends Object
Access properties that are set either via command line "-D" parameters or as environment variables. Command line parameters take precedence over environment variables.
-
-
Constructor Summary
Constructors Constructor Description PropertyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<Boolean>
getBooleanProperty(String key)
static boolean
getBooleanProperty(String key, boolean defaultValue)
static Optional<Double>
getDoubleProperty(String key)
static double
getDoubleProperty(String key, double defaultValue)
static Optional<Float>
getFloatProperty(String key)
static float
getFloatProperty(String key, float defaultValue)
static Optional<Integer>
getIntProperty(String key)
static int
getIntProperty(String key, int defaultValue)
static Optional<Long>
getLongProperty(String key)
static long
getLongProperty(String key, long defaultValue)
static Optional<String>
getProperty(String key)
static String
getProperty(String key, String defaultValue)
static boolean
isPropertySet(String key)
-
-
-
Method Detail
-
isPropertySet
public static boolean isPropertySet(String key)
-
getLongProperty
public static long getLongProperty(String key, long defaultValue)
-
getIntProperty
public static int getIntProperty(String key, int defaultValue)
-
getFloatProperty
public static float getFloatProperty(String key, float defaultValue)
-
getDoubleProperty
public static double getDoubleProperty(String key, double defaultValue)
-
getBooleanProperty
public static boolean getBooleanProperty(String key, boolean defaultValue)
-
-