@XStreamConverter(value=SObjectNodeXStreamConverter.class) public final class SObjectNode extends Object implements Serializable
SObjectTree
) are composed from instances of
SObjectNode
s. Each SObjectNode
contains Attributes
, 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 SObjectNode
s in it might
contain errors that you need to fetch using getErrors()
method.SObjectTree
,
RestError
,
Serialized FormModifier 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.
|
Map<String,Map<String,List<SObjectNode>>> |
children() |
List<RestError> |
getErrors()
Errors reported against this this node received in response to the SObject tree being submitted.
|
Iterable<SObjectNode> |
getIterableChildNodes()
Returns all children of this node (one level deep).
|
Iterable<SObjectNode> |
getIterableChildNodesOfType(String type)
Returns all children of this node (one level deep) of certain type (in plural form).
|
Iterable<AbstractSObjectBase> |
getIterableChildren()
Returns child SObjects of this node (one level deep).
|
Iterable<AbstractSObjectBase> |
getIterableChildrenOfType(String type)
Returns child SObjects of this node (one level deep) of certain type (in plural form)
|
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 List<RestError> getErrors()
public Iterable<SObjectNode> getIterableChildNodes()
public Iterable<SObjectNode> getIterableChildNodesOfType(String type)
type
- type of child requested in plural form (e.g for `Account` is `Accounts`)public Iterable<AbstractSObjectBase> getIterableChildren()
public Iterable<AbstractSObjectBase> getIterableChildrenOfType(String type)
type
- type of child requested in plural form (e.g for `Account` is `Accounts`)public AbstractSObjectBase getObject()
public boolean hasErrors()
public int size()
Apache Camel