public final class XNSerializables
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static XNElement |
createRequest(java.lang.String function,
java.lang.Object... nameValue)
Create a request with the given function and name-value pairs.
|
static XNElement |
createUpdate(java.lang.String function,
XNSerializable object)
Create an update request and store the contents of the object into it.
|
static <T extends XNSerializable> |
parseItem(XNElement item,
java.util.function.Supplier<T> creator)
Create an XNSerializable object through the
creator function
and load it from the item. |
static <T extends XNSerializable> |
parseList(XNElement container,
java.lang.String itemName,
java.util.function.Supplier<T> creator)
Parses an container for the given itemName elements and loads them into the
given Java XNSerializable object.
|
static XNElement |
storeItem(java.lang.String itemName,
XNSerializable source)
Store the value of a single serializable object with the given element name.
|
static XNElement |
storeList(java.lang.String container,
java.lang.String item,
java.lang.Iterable<? extends XNSerializable> source)
Create an XNElement with the given name and items stored from the source sequence.
|
public static XNElement createRequest(java.lang.String function, java.lang.Object... nameValue)
function - the remote function namenameValue - the array of String name and Object attributes.public static XNElement createUpdate(java.lang.String function, XNSerializable object)
function - the remote function nameobject - the object to store.public static <T extends XNSerializable> java.util.List<T> parseList(XNElement container, java.lang.String itemName, java.util.function.Supplier<T> creator)
T - the element object typecontainer - the container XNElementitemName - the item namecreator - the function to create Tspublic static <T extends XNSerializable> T parseItem(XNElement item, java.util.function.Supplier<T> creator)
creator function
and load it from the item.T - the XNSerializable objectitem - the item to load fromcreator - the function to create Tspublic static XNElement storeList(java.lang.String container, java.lang.String item, java.lang.Iterable<? extends XNSerializable> source)
container - the container nameitem - the item namesource - the source of itemspublic static XNElement storeItem(java.lang.String itemName, XNSerializable source)
itemName - the item element namesource - the object to store