public class PropertiesUtils extends Object
Operations on Properties that are null safe.
| Constructor and Description |
|---|
PropertiesUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Boolean |
getBooleanProperty(Properties properties,
String key)
Return boolean value for given key.
|
static org.joda.time.DateTime |
getDateProperty(Properties properties,
String key) |
static List<String> |
getListProperty(Properties properties,
String key) |
static Long |
getLongProperty(Properties properties,
String key) |
static String |
getStringProperty(Properties properties,
String key) |
static boolean |
isEmpty(Properties properties)
Checks if given properties object is empty or null.
|
static boolean |
isNotEmpty(Properties properties)
Checks if given properties object is not empty or not null.
|
static Object |
removeValue(Properties properties,
String key) |
static void |
setDateProperty(Properties properties,
String key,
org.joda.time.DateTime value) |
static void |
setListProperty(Properties properties,
String key,
List<String> values) |
static void |
setObjectProperty(Properties properties,
String key,
Object value) |
static void |
setStringProperty(Properties properties,
String key,
String value) |
public static boolean isEmpty(Properties properties)
Checks if given properties object is empty or null.
properties - the Properties to check, may be nulltrue if the Properties is empty or nullpublic static boolean isNotEmpty(Properties properties)
Checks if given properties object is not empty or not null.
properties - the Properties to check, may be nulltrue if the Properties is not empty or not nullpublic static void setStringProperty(Properties properties, String key, String value)
public static void setDateProperty(Properties properties, String key, org.joda.time.DateTime value)
public static void setObjectProperty(Properties properties, String key, Object value)
public static String getStringProperty(Properties properties, String key)
public static Object removeValue(Properties properties, String key)
public static org.joda.time.DateTime getDateProperty(Properties properties, String key)
public static Boolean getBooleanProperty(Properties properties, String key)
'true', 'on' or 'yes' (case
insensitive) will return true. 'false',
'off' or 'no' (case insensitive) will return
false. Otherwise, null is returned.
properties - key - public static Long getLongProperty(Properties properties, String key)
public static List<String> getListProperty(Properties properties, String key)
public static void setListProperty(Properties properties, String key, List<String> values)
Copyright © 2017 PAWLIDI.DE. All rights reserved.