Package org.linuxforhealth.fhir.path
Class FHIRPathAbstractNode
- java.lang.Object
-
- org.linuxforhealth.fhir.path.FHIRPathAbstractNode
-
- All Implemented Interfaces:
java.lang.Comparable<FHIRPathNode>
,FHIRPathNode
- Direct Known Subclasses:
FHIRPathAbstractSystemValue
,FHIRPathElementNode
,FHIRPathResourceNode
,FHIRPathTermServiceNode
,FHIRPathTypeInfoNode
public abstract class FHIRPathAbstractNode extends java.lang.Object implements FHIRPathNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPathAbstractNode.Builder
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Collection<FHIRPathNode>
children
protected java.lang.String
name
protected java.lang.String
path
protected FHIRPathType
type
protected FHIRPathSystemValue
value
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRPathAbstractNode(FHIRPathAbstractNode.Builder builder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends FHIRPathNode>
Tas(java.lang.Class<T> nodeType)
Cast this FHIRPathNode to the type specified in the parameterjava.util.Collection<FHIRPathNode>
children()
The child nodes of this FHIRPathNodejava.util.Collection<FHIRPathNode>
descendants()
A collection of descendant nodes of this FHIRPathNodeFHIRPathSystemValue
getValue()
The child system value of this FHIRPathNodeboolean
hasValue()
Indicates whether this FHIRPathNode has a child system value<T extends FHIRPathNode>
booleanis(java.lang.Class<T> nodeType)
Indicates whether this FHIRPathNode is type compatible with the parameterjava.lang.String
name()
The name (label) of this FHIRPathNodejava.lang.String
path()
The path of this FHIRPathNodejava.util.stream.Stream<FHIRPathNode>
stream()
A stream-based view of this FHIRPathNode and all of its descendantsabstract FHIRPathAbstractNode.Builder
toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instanceFHIRPathType
type()
The type of this FHIRPathNode-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.path.FHIRPathNode
accept, asElementNode, asResourceNode, asSystemValue, asTermServiceNode, asTypeInfoNode, isComparableTo, isElementNode, isResourceNode, isSystemValue, isTermServiceNode, isTypeInfoNode
-
-
-
-
Field Detail
-
name
protected final java.lang.String name
-
path
protected final java.lang.String path
-
type
protected final FHIRPathType type
-
value
protected final FHIRPathSystemValue value
-
children
protected final java.util.Collection<FHIRPathNode> children
-
-
Constructor Detail
-
FHIRPathAbstractNode
protected FHIRPathAbstractNode(FHIRPathAbstractNode.Builder builder)
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:FHIRPathNode
The name (label) of this FHIRPathNode- Specified by:
name
in interfaceFHIRPathNode
- Returns:
- the name of this FHIRPathNode if exists, otherwise null
-
path
public java.lang.String path()
Description copied from interface:FHIRPathNode
The path of this FHIRPathNode- Specified by:
path
in interfaceFHIRPathNode
- Returns:
- the path of this FHIRPathNode if exists, otherwise null
-
type
public FHIRPathType type()
Description copied from interface:FHIRPathNode
The type of this FHIRPathNode- Specified by:
type
in interfaceFHIRPathNode
- Returns:
- the type of this FHIRPathNode
-
hasValue
public boolean hasValue()
Description copied from interface:FHIRPathNode
Indicates whether this FHIRPathNode has a child system value- Specified by:
hasValue
in interfaceFHIRPathNode
- Returns:
- true if this FHIRPathNode has a child system value, otherwise false
-
getValue
public FHIRPathSystemValue getValue()
Description copied from interface:FHIRPathNode
The child system value of this FHIRPathNode- Specified by:
getValue
in interfaceFHIRPathNode
- Returns:
- the child system value of this FHIRPathNode, otherwise null
-
children
public java.util.Collection<FHIRPathNode> children()
Description copied from interface:FHIRPathNode
The child nodes of this FHIRPathNode- Specified by:
children
in interfaceFHIRPathNode
- Returns:
- a collection of child nodes for this FHIRPathNode if exists, otherwise empty collection
-
descendants
public java.util.Collection<FHIRPathNode> descendants()
Description copied from interface:FHIRPathNode
A collection of descendant nodes of this FHIRPathNode- Specified by:
descendants
in interfaceFHIRPathNode
- Returns:
- a collection of descendant nodes of this FHIRPathNode if exists, otherwise empty collection
-
stream
public java.util.stream.Stream<FHIRPathNode> stream()
Description copied from interface:FHIRPathNode
A stream-based view of this FHIRPathNode and all of its descendants- Specified by:
stream
in interfaceFHIRPathNode
- Returns:
- A stream containing this FHIRPathNode and all of its descendants
-
is
public final <T extends FHIRPathNode> boolean is(java.lang.Class<T> nodeType)
Description copied from interface:FHIRPathNode
Indicates whether this FHIRPathNode is type compatible with the parameter- Specified by:
is
in interfaceFHIRPathNode
- Type Parameters:
T
- FHIRPathNode or one of its implementations- Parameters:
nodeType
- the nodeType we are checking against- Returns:
- true if this FHIRPathNode is type compatible with
nodeType
, otherwise false
-
as
public final <T extends FHIRPathNode> T as(java.lang.Class<T> nodeType)
Description copied from interface:FHIRPathNode
Cast this FHIRPathNode to the type specified in the parameter- Specified by:
as
in interfaceFHIRPathNode
- Type Parameters:
T
- FHIRPathNode or one of its implementations- Parameters:
nodeType
- the nodeType we are casting to- Returns:
- this FHIRPathNode cast to the type specified in the parameter
-
toBuilder
public abstract FHIRPathAbstractNode.Builder toBuilder()
Convert thisFHIRPathNode
instance into aFHIRPathNode.Builder
instance- Returns:
- a new
FHIRPathNode.Builder
instance containing the fields from thisFHIRPathNode
instance
-
-