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