@XStreamConverter(value=SObjectNodeXStreamConverter.class) public final class SObjectNode extends Object implements Serializable
SObjectTree) are composed from instances of SObjectNodes.
Each SObjectNode contains the SObject (AbstractSObjectBase)
and any child records linked to it. SObjects at root level are added to
SObjectTree using SObjectTree.addObject(AbstractSObjectBase),
then you can add child records on the SObjectNode returned by using
addChild(AbstractDescribedSObjectBase),
addChildren(AbstractDescribedSObjectBase, AbstractDescribedSObjectBase...)
or addChild(String, AbstractSObjectBase) and
addChildren(String, AbstractSObjectBase, AbstractSObjectBase...).
Upon submission to the Salesforce Composite API the SObjectTree and
the SObjectNodes in it might contain errors that you need to fetch
using getErrors() method.SObjectTree,
RestError,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
SObjectNode |
addChild(AbstractDescribedSObjectBase child)
Add a described child with the metadata needed already present within it
to the this node.
|
SObjectNode |
addChild(String labelPlural,
AbstractSObjectBase child)
Add a child that does not contain the required metadata to the this node.
|
void |
addChildren(AbstractDescribedSObjectBase first,
AbstractDescribedSObjectBase... others)
Add multiple described children with the metadata needed already present
within them to the this node..
|
void |
addChildren(String labelPlural,
AbstractSObjectBase first,
AbstractSObjectBase... others)
Add a child that does not contain the required metadata to the this node.
|
Stream<SObjectNode> |
getChildNodes()
Returns all children of this node (one level deep).
|
Stream<SObjectNode> |
getChildNodesOfType(String type)
Returns all children of this node (one level deep) of certain type (in
plural form).
|
Stream<AbstractSObjectBase> |
getChildren()
Returns child SObjects of this node (one level deep).
|
Stream<AbstractSObjectBase> |
getChildrenOfType(String type)
Returns child SObjects of this node (one level deep) of certain type (in
plural form)
|
List<RestError> |
getErrors()
Errors reported against this this node received in response to the
SObject tree being submitted.
|
AbstractSObjectBase |
getObject()
SObject at this node.
|
boolean |
hasErrors()
Are there any errors resulted from the submission on this node?
|
int |
size()
Size of the branch beginning with this node (number of SObjects in it).
|
String |
toString() |
public SObjectNode addChild(AbstractDescribedSObjectBase child)
child - to addpublic SObjectNode addChild(String labelPlural, AbstractSObjectBase child)
labelPlural - plural formchild - to addpublic void addChildren(AbstractDescribedSObjectBase first, AbstractDescribedSObjectBase... others)
first - first child to addothers - any other children to addpublic void addChildren(String labelPlural, AbstractSObjectBase first, AbstractSObjectBase... others)
labelPlural - plural formfirst - first child to addothers - any other children to addpublic Stream<SObjectNode> getChildNodes()
public Stream<SObjectNode> getChildNodesOfType(String type)
type - type of child requested in plural form (e.g for `Account` is
`Accounts`)public Stream<AbstractSObjectBase> getChildren()
public Stream<AbstractSObjectBase> getChildrenOfType(String type)
type - type of child requested in plural form (e.g for `Account` is
`Accounts`)public List<RestError> getErrors()
public AbstractSObjectBase getObject()
public boolean hasErrors()
public int size()
Apache Camel