Package org.openspaces.core.util
Class StringPropertiesUtils
java.lang.Object
org.openspaces.core.util.StringPropertiesUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertPropertiesToMapStringString(Properties properties2) static String[]static String[]static booleangetBoolean(Map<String, String> properties, String key, boolean defaultValue) static ObjectGets an object that has a constructor that accepts Map<String,String> as a single argumentstatic doublestatic doublegetDoubleIgnoreExceptions(Map<String, String> properties, String key, double defaultValue) static intgetInteger(Map<String, String> properties, String key, int defaultValue) static intgetIntegerIgnoreExceptions(Map<String, String> properties, String key, int defaultValue) getKeyValuePairs(Map<String, String> properties, String key, String pairSeperator, String keyValueSeperator, Map<String, String> defaultValue) static longstatic longgetLongIgnoreExceptions(Map<String, String> properties, String key, long defaultValue) static ObjectGets an object that has a constructor that accepts String as a single argumentload(InputStream in) static voidConcatenates the specified array into a combined string using the space separator and puts the result as a value into the specified properties with the specified key.static voidConcatenates the specified array into a combined string using the specified separator and puts the result as a value into the specified properties with the specified key.static voidputBoolean(Map<String, String> properties, String key, boolean value) static voidPuts an object that has a constructor that accepts Map<String,String> as a single argument and has a getProperties method which returns a Map<String,String> If object is null it is removed from the mapstatic voidstatic voidputInteger(Map<String, String> properties, String key, int value) static voidputKeyValuePairs(Map<String, String> properties, String key, Map<String, String> value, String pairSeperator, String keyValueSeperator) static voidstatic voidPuts the map as a value by adding the specified prefix to each key If value is null the object is removed from properties.static voidstatic voidPuts an object that has a constructor that accepts String as a single argumentstatic voidstatic String
-
Constructor Details
-
StringPropertiesUtils
public StringPropertiesUtils()
-
-
Method Details
-
store
public static void store(Map<String, String> properties, OutputStream out, String comments) throws IOException- Throws:
IOException
-
load
- Throws:
IOException
-
convertPropertiesToMapStringString
-
load
- Throws:
IOException
-
getInteger
public static int getInteger(Map<String, String> properties, String key, int defaultValue) throws NumberFormatException- Throws:
NumberFormatException
-
getIntegerIgnoreExceptions
-
putLong
-
getLong
public static long getLong(Map<String, String> properties, String key, long defaultValue) throws NumberFormatException- Throws:
NumberFormatException
-
getLongIgnoreExceptions
-
putDouble
-
getDouble
public static double getDouble(Map<String, String> properties, String key, double defaultValue) throws NumberFormatException- Throws:
NumberFormatException
-
getDoubleIgnoreExceptions
-
putArray
public static void putArray(Map<String, String> properties, String key, String[] array, String separator) Concatenates the specified array into a combined string using the specified separator and puts the result as a value into the specified properties with the specified key. The values in the array must not contain the separator otherwise an IllegalArgumentException is raised. Null or empty arrays will remove the key from the properties map -
getArray
-
getSet
-
putSet
-
putArgumentsArray
Concatenates the specified array into a combined string using the space separator and puts the result as a value into the specified properties with the specified key. If the values in the array contains whitespace it is enclosed with " or ' characters -
getArgumentsArray
-
putInteger
-
putBoolean
-
getBoolean
-
getMap
-
putMap
public static void putMap(Map<String, String> properties, String keyPrefix, Map<String, String> value) Puts the map as a value by adding the specified prefix to each key If value is null the object is removed from properties. -
toString
-
putKeyValuePairs
-
getKeyValuePairs
-
putConfig
Puts an object that has a constructor that accepts Map<String,String> as a single argument and has a getProperties method which returns a Map<String,String> If object is null it is removed from the map -
getConfig
Gets an object that has a constructor that accepts Map<String,String> as a single argument -
putStringWrapperObject
Puts an object that has a constructor that accepts String as a single argument -
getStringWrapperObject
public static Object getStringWrapperObject(Map<String, String> properties, String key, Object defaultValue) Gets an object that has a constructor that accepts String as a single argument
-