public final class UtlProps extends Object
| Constructor and Description |
|---|
UtlProps() |
| Modifier and Type | Method and Description |
|---|---|
static Properties |
deserialize(String str)
Deerialize a property table from a string
|
static Properties |
getSubProps(Properties props,
String prefix,
boolean removePrefix,
Properties subProps)
Gets a new set of roperties starting with the given prefix from the provided properties set.
|
static <T extends Map<String,Object>> |
getSubProps(Properties props,
String prefix,
boolean removePrefix,
T subProps)
Gets a new set of roperties starting with the given prefix from the provided properties set.
|
static Object |
getValue(Map<String,Object> props,
String name)
Get the value of a property from a property table.
|
static boolean |
getValue(Map<String,Object> props,
String name,
boolean defValue)
Convenience method to return a property value as a boolean value
|
static byte |
getValue(Map<String,Object> props,
String name,
byte defValue)
Convenience method to return a property value as a numeric value
|
static double |
getValue(Map<String,Object> props,
String name,
double defValue)
Convenience method to return a property value as a double value
|
static float |
getValue(Map<String,Object> props,
String name,
float defValue)
Convenience method to return a property value as a float value
|
static int |
getValue(Map<String,Object> props,
String name,
int defValue)
Convenience method to return a property value as an int value
|
static long |
getValue(Map<String,Object> props,
String name,
long defValue)
Convenience method to return a property value as an long value
|
static short |
getValue(Map<String,Object> props,
String name,
short defValue)
Convenience method to return a property value as a short value
|
static String |
getValue(Map<String,Object> props,
String name,
String defValue)
Convenience method to return a property value as a String value
|
static String |
getValue(Properties props,
String name)
Get the value of a property from a property table.
|
static boolean |
getValue(Properties props,
String name,
boolean defValue)
Convenience method to return a property value as a boolean value
|
static byte |
getValue(Properties props,
String name,
byte defValue)
Convenience method to return a property value as a byte value
|
static double |
getValue(Properties props,
String name,
double defValue)
Convenience method to return a property value as a double value
|
static float |
getValue(Properties props,
String name,
float defValue)
Convenience method to return a property value as a float value
|
static int |
getValue(Properties props,
String name,
int defValue)
Convenience method to return a property value as an int value
|
static long |
getValue(Properties props,
String name,
long defValue)
Convenience method to return a property value as an long value
|
static short |
getValue(Properties props,
String name,
short defValue)
Convenience method to return a property value as a short value
|
static String |
getValue(Properties props,
String name,
String defValue)
Convenience method to return a property value as a String value
|
static void |
serialize(Properties props,
StringBuilder builder)
Serialize a property table to a string
|
public static final byte getValue(Properties props, String name, byte defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final short getValue(Properties props, String name, short defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final int getValue(Properties props, String name, int defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final long getValue(Properties props, String name, long defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final float getValue(Properties props, String name, float defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final double getValue(Properties props, String name, double defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final boolean getValue(Properties props, String name, boolean defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
boolean value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final String getValue(Properties props, String name)
props - The property tablename - The property namepublic static final String getValue(Properties props, String name, String defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
string value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final byte getValue(Map<String,Object> props, String name, byte defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final short getValue(Map<String,Object> props, String name, short defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final int getValue(Map<String,Object> props, String name, int defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final long getValue(Map<String,Object> props, String name, long defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final float getValue(Map<String,Object> props, String name, float defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final double getValue(Map<String,Object> props, String name, double defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
numeric value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final boolean getValue(Map<String,Object> props, String name, boolean defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
boolean value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final Object getValue(Map<String,Object> props, String name)
props - The property table.name - The property namepublic static final String getValue(Map<String,Object> props, String name, String defValue)
props - The property tablename - The property namedefValue - The default property value to return in case the property
could not be found in the property table.
This method is a convenience method that returns a property value as a
string value. It uses getValue(java.util.Properties, java.lang.String, byte) to retrieve the property
value. The default value is returned in case the no property with the
provided name exists in the property table.
public static final void serialize(Properties props, StringBuilder builder)
props - The property table to serializebuilder - The string builder to serialize it to.public static final Properties deserialize(String str)
str - The string to deserialize it from.public static final <T extends Map<String,Object>> T getSubProps(Properties props, String prefix, boolean removePrefix, T subProps)
Given:
props - The properties from which to extract the prefixed properties.prefix - The prefix to match.removePrefix - Whether the prefix is removed.subProps - The target map into which to add the matching properties.public static final Properties getSubProps(Properties props, String prefix, boolean removePrefix, Properties subProps)
Given:
props - The properties from which to extract the prefixed properties.prefix - The prefix to match.removePrefix - Whether the prefix is removed.subProps - The target map into which to add the matching properties.Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.