Class SObjectNode
java.lang.Object
org.apache.camel.component.salesforce.api.dto.composite.SObjectNode
- All Implemented Interfaces:
Serializable
Represents one node in the SObject tree request. SObject trees (
SObjectTree
) are composed from instances of
SObjectNode
s. 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 SObjectNode
s in it might
contain errors that you need to fetch using getErrors()
method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddChild
(String labelPlural, AbstractSObjectBase child) Add a child that does not contain the required metadata to the this node.Add a described child with the metadata needed already present within it 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.void
addChildren
(AbstractDescribedSObjectBase first, AbstractDescribedSObjectBase... others) Add multiple described children with the metadata needed already present within them to the this node..Returns all children of this node (one level deep).getChildNodesOfType
(String type) Returns all children of this node (one level deep) of certain type (in plural form).Returns child SObjects of this node (one level deep).getChildrenOfType
(String type) Returns child SObjects of this node (one level deep) of certain type (in plural form)Errors reported against this this node received in response to the SObject tree being submitted.SObject at this node.boolean
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).toString()
-
Method Details
-
addChild
Add a described child with the metadata needed already present within it to the this node.- Parameters:
child
- to add- Returns:
- the newly created node, used in builder fashion to add more child objects to it (on the next level)
-
addChild
Add a child that does not contain the required metadata to the this node. You need to specify the plural form of the child (e.g. `Account` its `Accounts`).- Parameters:
labelPlural
- plural formchild
- to add- Returns:
- the newly created node, used in builder fashion to add more child objects to it (on the next level)
-
addChildren
Add multiple described children with the metadata needed already present within them to the this node..- Parameters:
first
- first child to addothers
- any other children to add
-
addChildren
public void addChildren(String labelPlural, AbstractSObjectBase first, AbstractSObjectBase... others) Add a child that does not contain the required metadata to the this node. You need to specify the plural form of the child (e.g. `Account` its `Accounts`).- Parameters:
labelPlural
- plural formfirst
- first child to addothers
- any other children to add
-
getChildNodes
Returns all children of this node (one level deep).- Returns:
- children of this node
-
getChildNodesOfType
Returns all children of this node (one level deep) of certain type (in plural form).- Parameters:
type
- type of child requested in plural form (e.g for `Account` is `Accounts`)- Returns:
- children of this node of specified type
-
getChildren
Returns child SObjects of this node (one level deep).- Returns:
- child SObjects of this node
-
getChildrenOfType
Returns child SObjects of this node (one level deep) of certain type (in plural form)- Parameters:
type
- type of child requested in plural form (e.g for `Account` is `Accounts`)- Returns:
- child SObjects of this node
-
getErrors
Errors reported against this this node received in response to the SObject tree being submitted.- Returns:
- errors for this node
-
getObject
SObject at this node.- Returns:
- SObject
-
hasErrors
public boolean hasErrors()Are there any errors resulted from the submission on this node?- Returns:
- true if there are errors
-
size
public int size()Size of the branch beginning with this node (number of SObjects in it).- Returns:
- number of objects within this branch
-
toString
-