class PersistenceHelper extends Object
| Constructor and Description |
|---|
PersistenceHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void | add(StringBuilder buf,
boolean addComments,
String prefix,
String name,
String description,
double value)Append a double value to the buffer. |
static void | add(StringBuilder buf,
boolean addComments,
String prefix,
String name,
String description,
long value)Append a long value to the buffer. |
static void | addDate(StringBuilder buf,
boolean addComments,
String prefix,
String name,
String description,
long value)Append a date value to the buffer. |
static void | addTime(StringBuilder buf,
boolean addComments,
String prefix,
String name,
String description,
long value)Append a time duration to the buffer. |
static double | getDouble(Properties props,
String prefix,
String name)Read a double value from properties. |
static int | getInt(Properties props,
String prefix,
String name)Read an integer value from properties. |
static long | getLong(Properties props,
String prefix,
String name)Read a long value from properties. |
public static final void add(StringBuilder buf, boolean addComments, String prefix, String name, String description, double value)
buf - the buffer to append toaddComments - if true, prepend a comment line instead of the valueprefix - property key prefixname - property key suffixdescription - description of the value (used as comment when addComments is true)value - the valuepublic static final void add(StringBuilder buf, boolean addComments, String prefix, String name, String description, long value)
buf - the buffer to append toaddComments - if true, prepend a comment line instead of the valueprefix - property key prefixname - property key suffixdescription - description of the value (used as comment when addComments is true)value - the valuepublic static final void addDate(StringBuilder buf, boolean addComments, String prefix, String name, String description, long value)
buf - the buffer to append toaddComments - if true, prepend a comment line instead of the valueprefix - property key prefixname - property key suffixdescription - description of the value (used as comment when addComments is true)value - the epoch millisecond date valuepublic static final void addTime(StringBuilder buf, boolean addComments, String prefix, String name, String description, long value)
buf - the buffer to append toaddComments - if true, prepend a comment line instead of the valueprefix - property key prefixname - property key suffixdescription - description of the value (used as comment when addComments is true)value - the duration in millisecondspublic static final double getDouble(Properties props, String prefix, String name)
props - properties to read fromprefix - property key prefixname - property key suffixpublic static final int getInt(Properties props, String prefix, String name)
props - properties to read fromprefix - property key prefixname - property key suffixpublic static final long getLong(Properties props, String prefix, String name)
props - properties to read fromprefix - property key prefixname - property key suffix