public abstract class OrbitalProperties extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
OrbitalProperties.DateFormatGenerator |
static interface |
OrbitalProperties.TimeGenerator
Interface to generate a time stamp.
|
| Constructor and Description |
|---|
OrbitalProperties() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPropertyFile(String path)
Add a properties file to the global set of properties.
|
static ThreadLocal<DateFormat> |
dateFormatFactory(OrbitalProperties.DateFormatGenerator generator) |
static boolean |
getBooleanGlobalProperty(String key) |
static boolean |
getBooleanGlobalProperty(String key,
boolean def) |
static Date |
getCurrentDate() |
static long |
getCurrentTime()
Return current time as returned by the current time generator.
|
static String |
getGlobalProperty(String key) |
static String |
getGlobalProperty(String key,
String def) |
static long |
getLongGlobalProperty(String key) |
static long |
getLongGlobalProperty(String key,
long def) |
static int |
getNonzeroLimited(int provided,
int max)
Convenience function to return a value in the range [1, max] where:
max is returned if "provided" < 1 (that is, < 1 is treated as use available max);
max is returned if "provided" > max;
otherwise, "provided" is returned.
|
static String |
getPropertyName(Class<?> caller,
String attribute)
Generate a standard property name for some attribute of a given class.
|
static boolean |
isAssertEnabled() |
static void |
setGlobalProperty(String key,
String value) |
static void |
setTimeGenerator(OrbitalProperties.TimeGenerator tg) |
public static boolean isAssertEnabled()
public static final void addPropertyFile(String path) throws IOException
path - path to properties file to load.IOException - if an error occurs while loading the filepublic static final String getPropertyName(Class<?> caller, String attribute)
caller - the class to be used to form the fully qualified named bit.attribute - the attribute name to tag onto the class.public static final int getNonzeroLimited(int provided,
int max)
provided - value provided by a callermax - maximum value to allow.public static void setTimeGenerator(OrbitalProperties.TimeGenerator tg)
public static long getCurrentTime()
public static Date getCurrentDate()
public static boolean getBooleanGlobalProperty(String key)
public static boolean getBooleanGlobalProperty(String key, boolean def)
public static long getLongGlobalProperty(String key)
public static long getLongGlobalProperty(String key, long def)
public static ThreadLocal<DateFormat> dateFormatFactory(OrbitalProperties.DateFormatGenerator generator)
Copyright © 2018 Orbital Enterprises. All rights reserved.