public final class Tools extends Object
Modifier and Type | Method and Description |
---|---|
static org.joda.time.DateTime |
fromUTC(org.joda.time.DateTime utcTime)
Converts UTC instant of
DateTime to local instant of DateTime with default time zone. |
static org.joda.time.DateTime |
fromUTC(long utcMillis)
Converts UTC time in millis to local
DateTime with default time zone. |
static String |
joinNonEmpty(String[] array,
char separator)
Joins the provided input Strings into one String, separated by the provided separator character.
|
static String |
marshalToXml(Object obj,
Class sourceClass)
Marshals object graph into XML.
|
static <T> String |
marshalToXml(T obj,
QName qName)
Marshals object graph into XML.
|
static String |
toString(Object value)
Returns the string representation of the
Object argument. |
static org.joda.time.DateTime |
toUTC(org.joda.time.DateTime localDateTime)
Converts local instant of
DateTime to standard UTC instant of DateTime with UTC time zone. |
static <T> T |
unmarshalFromXml(String xml,
Class<T> targetClass)
Unmarshals XML into object graph.
|
public static String toString(Object value)
Object
argument.value
- an Object
.null
, then
null
; otherwise, the value of
value.toString()
is returned.public static String joinNonEmpty(String[] array, char separator)
array
- an array of String to join together into one Stringseparator
- separator character to separate the array elements withpublic static String marshalToXml(Object obj, Class sourceClass)
obj
- the object graphsourceClass
- the input classXmlConverter
public static <T> String marshalToXml(T obj, QName qName)
obj
- the object graphqName
- the QNameMarshaller
public static <T> T unmarshalFromXml(String xml, Class<T> targetClass)
xml
- the input stringtargetClass
- the target classXmlConverter
public static org.joda.time.DateTime toUTC(org.joda.time.DateTime localDateTime)
DateTime
to standard UTC instant of DateTime
with UTC time zone.localDateTime
- the local timepublic static org.joda.time.DateTime fromUTC(org.joda.time.DateTime utcTime)
DateTime
to local instant of DateTime
with default time zone.utcTime
- the UTC timepublic static org.joda.time.DateTime fromUTC(long utcMillis)
DateTime
with default time zone.utcMillis
- the UTC time in millisCopyright © 2016. All rights reserved.