|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxsmeral.semnet.util.Util
public class Util
Various utility methods.
Constructor Summary | |
---|---|
Util()
|
Method Summary | ||
---|---|---|
static
|
nonNull(T... objects)
Simplifies the following expression: a ! |
|
static Object |
nonNullObject(Object... objects)
Non-generic version of nonNull(T...) |
|
static
|
objectFromXml(String xmlFileName,
Class<T> cls)
Deserializes an object from XML file, using XStream |
|
static boolean |
objectToXml(Object obj,
String xmlFileName)
Serializes an object to XML file, using XStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static <T> T nonNull(T... objects)
a != null ? a : b != null ? b : cto
nonNull(a, b, c)
T
- Any object type (or primitive (autoboxed))objects
- The objects
public static Object nonNullObject(Object... objects)
nonNull(T...)
public static <T> T objectFromXml(String xmlFileName, Class<T> cls) throws ConfigurationException
xmlFileName
- Name of the XML filecls
- The class of the object
ConfigurationException
public static boolean objectToXml(Object obj, String xmlFileName)
obj
- The object to serializexmlFileName
- Name of the XML file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |