Package org.instancio.internal.nodes
Class InternalNode
java.lang.Object
org.instancio.internal.nodes.InternalNode
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic InternalNode.Builderbuilder()booleanReturns this node's children.intgetDepth()getField()Returns a field associated with this node, ornullif none.Class<?>Returns the raw type equivalent to this node'sgetType().Class<?>Returns the target class represented by this node.getType()Returns the type represented by this node, either aClassorParameterizedType.booleanThis method is used for detecting cycles.inthashCode()static InternalNodebooleanvoidsetChildren(List<InternalNode> children) toString()
-
Method Details
-
ignoredNode
-
getNodeKind
-
is
-
toBuilder
-
builder
-
getNodeContext
-
getType
Returns the type represented by this node, either aClassorParameterizedType.- Returns:
- type represented by this node
-
getRawType
Returns the raw type equivalent to this node'sgetType(). In the absence of subtype mapping, this method andgetTargetClass()return the same value.- Returns:
- raw type represented by this node.
- See Also:
-
getTargetClass
Returns the target class represented by this node.- Returns:
- target class represented by this node
- See Also:
-
getField
Returns a field associated with this node, ornullif none.- Returns:
- field, if present, or
null
-
getParent
-
getTypeMap
-
getOnlyChild
-
getChildren
Returns this node's children. For "container" nodes like arrays, collections, and maps, the children will be nodes representing array/collection element or map key/value. For other nodes, the children are based on thegetTargetClass()fields.A node (including container nodes) may not have children in case of cyclic relationships. An empty list would be returned to break the cycle.
- Returns:
- this node's children or an empty list if none
-
setChildren
-
hasAncestorEqualToSelf
public boolean hasAncestorEqualToSelf()This method is used for detecting cycles. If this node is equal to any of its ancestors, then there is a cycle.- Returns:
trueif this node has an ancestor equal to it,falseotherwise.
-
getDepth
public int getDepth() -
equals
-
hashCode
public int hashCode() -
toString
-