Package org.instancio.internal.nodes
Class Node
java.lang.Object
org.instancio.internal.nodes.Node
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Node.Builder
builder()
boolean
Returns this node's children.getField()
Returns a field associated with this node, ornull
if 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 aClass
orParameterizedType
.boolean
This method is used for detecting cycles.int
hashCode()
boolean
void
setChildren
(List<Node> children) toString()
-
Method Details
-
getNodeKind
-
is
-
toBuilder
-
builder
-
getNodeContext
-
getType
Returns the type represented by this node, either aClass
orParameterizedType
.- 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, ornull
if 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:
true
if this node has an ancestor equal to it,false
otherwise.
-
equals
-
hashCode
public int hashCode() -
getNodeName
-
toString
-