public class RMUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
isApp |
static boolean |
isApplet |
static boolean |
isEmbedded |
static boolean |
isJava5 |
static boolean |
isJava6 |
static boolean |
isJava7 |
static boolean |
isMac |
static boolean |
isWindows |
Constructor and Description |
---|
RMUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
add(java.lang.Object obj1,
java.lang.Object obj2)
Returns the sum of the two given objects (assumed to be strings or numbers).
|
static java.lang.Boolean |
booleanValue(java.lang.Object anObj)
Returns the Boolean for a given object (assumed to be Number or String).
|
static boolean |
boolValue(java.lang.Object anObj)
Returns a boolean value for the given object.
|
static boolean |
checkString(java.lang.String aString,
boolean isApplication)
Checks a string to see if it's valid.
|
static <T> T |
clone(T anObj)
Returns a clone of the given object (supports List, Map, RMObject, null and others by reflection).
|
static <T> T |
cloneDeep(T anObj)
Clones the given object, recursively, if the object is a collection.
|
static int |
compare(java.lang.Object anObj1,
java.lang.Object anObj2)
Returns result of comparing two values.
|
static boolean |
doOnce(java.lang.String anId)
Returns whether to do something once based on given unique id string.
|
static double |
doubleValue(java.lang.Object anObj)
Returns the double value for a given object (assumed to be a string or number).
|
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
Returns whether two objects are equal (supports either being null).
|
static float |
floatValue(java.lang.Object anObj)
Returns the float value for a given object (assumed to be a string or number).
|
static java.math.BigDecimal |
getBigDecimal(java.lang.Object anObj)
Returns the BigDecimal for a given object (assumed to be a string or number).
|
static java.lang.String |
getBuildInfo()
Returns a build date string (eg, "Jan-26-03") as generated into BuildInfo.txt at build time.
|
static byte[] |
getBytes(java.io.InputStream aStream)
Returns bytes for an input stream.
|
static byte[] |
getBytes(java.lang.Object aSource)
Returns a byte array from a File, String path, InputStream, URL, byte[], etc.
|
static byte[] |
getBytes2(java.io.InputStream aStream)
Returns bytes for an input stream.
|
static java.util.Date |
getDate(java.lang.Object anObj)
Returns a date for given object of arbitrary type.
|
static java.lang.Double |
getDouble(java.lang.Object anObj)
Returns a Double for a given object.
|
static java.lang.Float |
getFloat(java.lang.Object anObj)
Returns a Float for a given object.
|
static java.lang.String |
getHostname()
Returns the hostname for this machine.
|
static int |
getId(java.lang.String anId)
Returns a unique id for a string each time it's called, starting with 0.
|
static java.io.InputStream |
getInputStream(java.lang.Object aSource)
Returns an input stream from a File, String path, URL, byte array, InputStream, etc.
|
static java.lang.Integer |
getInteger(java.lang.Object anObj)
Returns the Integer for a given object.
|
static int |
getProcessorCount()
Returns the number of processors on this machine.
|
static java.lang.String |
getTempDir()
Returns the temp directory for this machine.
|
static float |
getVersion()
Returns the version number of the app.
|
static int |
intValue(java.lang.Object anObj)
Returns the int value for a given object (assumed to be a string or number).
|
static long |
longValue(java.lang.Object anObj)
Returns the long value for a given object (assumed to be a string or number).
|
static java.lang.Number |
numberValue(java.lang.Object anObj)
Returns the Number for a given object (assumed to be Number or String).
|
static void |
printlnOnce(java.io.PrintStream aStream,
java.lang.String aString)
Does a println of a given message to given print writer once.
|
static void |
setHeadless()
Sets this JVM to be headless.
|
static java.lang.String |
stringValue(java.lang.Object anObj)
Returns a String for a given arbitrary object.
|
static void |
writeBytes(byte[] bytes,
java.lang.Object aDest)
Writes the given bytes to the given output object (string path or file).
|
public static boolean isWindows
public static boolean isMac
public static boolean isApp
public static boolean isEmbedded
public static boolean isApplet
public static boolean isJava5
public static boolean isJava6
public static boolean isJava7
public static boolean boolValue(java.lang.Object anObj)
public static int intValue(java.lang.Object anObj)
public static long longValue(java.lang.Object anObj)
public static float floatValue(java.lang.Object anObj)
public static double doubleValue(java.lang.Object anObj)
public static java.lang.String stringValue(java.lang.Object anObj)
public static java.lang.Boolean booleanValue(java.lang.Object anObj)
public static java.lang.Number numberValue(java.lang.Object anObj)
public static java.lang.Integer getInteger(java.lang.Object anObj)
public static java.lang.Float getFloat(java.lang.Object anObj)
public static java.lang.Double getDouble(java.lang.Object anObj)
public static java.math.BigDecimal getBigDecimal(java.lang.Object anObj)
public static java.util.Date getDate(java.lang.Object anObj)
public static java.lang.Object add(java.lang.Object obj1, java.lang.Object obj2)
public static <T> T clone(T anObj)
public static <T> T cloneDeep(T anObj)
public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)
public static int compare(java.lang.Object anObj1, java.lang.Object anObj2)
public static java.lang.String getTempDir()
public static byte[] getBytes(java.lang.Object aSource)
public static byte[] getBytes(java.io.InputStream aStream)
public static byte[] getBytes2(java.io.InputStream aStream) throws java.io.IOException
java.io.IOException
public static java.io.InputStream getInputStream(java.lang.Object aSource)
public static void writeBytes(byte[] bytes, java.lang.Object aDest)
public static boolean checkString(java.lang.String aString, boolean isApplication)
public static java.lang.String getHostname()
public static java.lang.String getBuildInfo()
public static float getVersion()
public static int getProcessorCount()
public static void setHeadless()
public static int getId(java.lang.String anId)
public static boolean doOnce(java.lang.String anId)
public static void printlnOnce(java.io.PrintStream aStream, java.lang.String aString)