Class SObjectNode

    • Method Detail

      • addChild

        public SObjectNode addChild​(AbstractDescribedSObjectBase child)
        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

        public SObjectNode addChild​(String labelPlural,
                                    AbstractSObjectBase child)
        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 form
        child - to add
        Returns:
        the newly created node, used in builder fashion to add more child objects to it (on the next level)
      • addChildren

        public void addChildren​(AbstractDescribedSObjectBase first,
                                AbstractDescribedSObjectBase... others)
        Add multiple described children with the metadata needed already present within them to the this node..
        Parameters:
        first - first child to add
        others - 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 form
        first - first child to add
        others - any other children to add
      • getChildNodes

        public Stream<SObjectNode> getChildNodes()
        Returns all children of this node (one level deep).
        Returns:
        children of this node
      • getChildNodesOfType

        public Stream<SObjectNode> getChildNodesOfType​(String type)
        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

        public Stream<AbstractSObjectBase> getChildren()
        Returns child SObjects of this node (one level deep).
        Returns:
        child SObjects of this node
      • getChildrenOfType

        public Stream<AbstractSObjectBase> getChildrenOfType​(String type)
        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

        public List<RestError> getErrors()
        Errors reported against this this node received in response to the SObject tree being submitted.
        Returns:
        errors for this node
      • 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