public final class MCast extends Object
All Funktions are static.
| Constructor and Description |
|---|
MCast() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCaster(Caster<?,?> caster,
boolean overwrite) |
static byte |
byteFromHex(String in,
int offset)
Convert a two letter hex value to a single byte value.
|
static byte[] |
fromBinaryString(String in)
Convert a string with hex values in a byte array.
|
static Date |
objectToDate(Object value) |
static String |
objectToString(Object value) |
static String |
toBinaryString(byte[] in)
Convert the byte array to a string representation.
|
static boolean |
toboolean(Object _in,
boolean _default)
Convert String to boolean.
|
static byte[] |
toByteArray(String in) |
static Calendar |
toCalendar(Date in) |
static Calendar |
toCalendar(Date _in,
TimeZone tz,
Locale l) |
static Calendar |
toCalendar(String in)
Parse a time date string.
|
static Calendar |
toCalendar(String in,
Calendar def)
Parse time and date and return calendar.
|
static String |
toCurrencyString(double _in)
Will round the value mathematically and
return every time a comma as separator and
two digits after comma.
|
static Date |
toDate(String in,
Date def)
Try to parse a String and return the equivalent Date object.
|
static double |
todouble(Object in,
double def)
Convert a string to double.
|
static float |
tofloat(Object in,
float def)
Convert a string to float.
|
static String |
toHex2String(byte in)
Convert a byte to a two letter hex value.
|
static String |
toHex2String(int _in)
Convert integer to two letter hex code.
|
static String |
toHex4String(int _in)
Convert integer to four letter hex code.
|
static Map<String,Object> |
toIndexedMap(Object... values)
Return an indexed map of the values.
|
static int |
toint(Object in,
int def)
Converts String to int.
|
static int |
tointFromHex(String _in) |
static long |
tolong(Object in,
long def)
Converts a string to long.
|
static Date |
toSqlDate(Date date) |
static String |
toString(boolean _in)
Convert a boolean to string.
|
static String |
toString(byte[] in) |
static String |
toString(double in)
Convert a double to string.
|
static String |
toString(float in)
Convert a double to string.
|
static String |
toString(int _in)
Converts integer to String.
|
static String |
toString(int _in,
int _digits)
Converts integer to string with the minimum digits.
|
static String |
toString(long _in)
Convert long to string.
|
static String |
toString(Object in) |
static String |
toString(Object in,
String def) |
static String |
toString(String firstLine,
StackTraceElement[] trace) |
static String |
toString(Throwable t) |
static String[] |
toStringArray(List<?> _v)
Put all list elements in a string list.
|
static Object |
toType(Object in,
Class<?> type,
Object def) |
public static String toCurrencyString(double _in)
_in - public static void addCaster(Caster<?,?> caster, boolean overwrite)
public static Date toDate(String in, Date def)
If the time is not in the string, it will be set to "00:00:00". It is possible to leave year, in this case it will be replaced with the actuall year. If you leave month, it will be replaced with the actuall month.
in - def - public static Calendar toCalendar(String in)
in - public static Calendar toCalendar(String in, Calendar def)
in - def - public static String toBinaryString(byte[] in)
in - UnsupportedEncodingExceptionpublic static byte[] fromBinaryString(String in)
in - toBinaryStringpublic static byte byteFromHex(String in, int offset)
in - offset - public static String toHex2String(byte in)
in - UnsupportedEncodingExceptionpublic static boolean toboolean(Object _in, boolean _default)
_in - _default - public static float tofloat(Object in, float def)
in - def - public static double todouble(Object in, double def)
in - def - public static int toint(Object in, int def)
in - def - public static long tolong(Object in, long def)
in - def - public static String toString(double in)
in - public static String toString(float in)
in - public static String toString(boolean _in)
_in - public static String toString(int _in)
_in - public static String toString(int _in, int _digits)
_in - _numbers - public static String toString(long _in)
_in - public static String toHex2String(int _in)
_in - public static String toHex4String(int _in)
_in - public static String[] toStringArray(List<?> _v)
_v - public static int tointFromHex(String _in)
public static String toString(byte[] in)
public static byte[] toByteArray(String in)
public static String toString(String firstLine, StackTraceElement[] trace)
public static Map<String,Object> toIndexedMap(Object... values)
values - Copyright © 2014. All rights reserved.