QL
- The query link actual interface type, used for method chaining.public interface QueryLink<QL extends QueryLink<QL>> extends SupportsInvisibility<QueryLink<QL>>
name()
).source
" and "target
"
("from" and "to"). These designations may refer to different nodes on the query definition, or may refer to the
same node (self link).Invisibility status
- an invisible link acts only as a condition on its connected nodes,
while a visible link both acts as a condition and enriches the result with (one or more)
Relations
.UNBOUNDED
), since that link will not
restrict any adjacent query node.expression trees
- the source node expression tree and the target node
expression tree.
By default, a link is added with an "and" condition to the top of both expression trees, with cardinality
1..* (unbounded), which is the same as saying:
"A CI is valid as a result of the source node only if there is at least one outgoing link between it and a CI
matching the target node. A CI is valid as a result of the target node only if there is at least one incoming link
between it and a CI matching the source node."
setting it
to the node.
Using this method allows for complex logical expressions, with multiple instances of each query link and different
cardinality settings for each of these instances.Modifier and Type | Field and Description |
---|---|
static int |
UNBOUNDED
Represents an unbounded cardinality value.
|
Modifier and Type | Method and Description |
---|---|
DirectLink |
asDirectLink()
Returns this object as a DirectLink.
|
IndirectLink |
asIndirectLink()
Returns this object as an IndirectLink.
|
OnPropertiesLink |
asOnPropertiesLink()
Returns this object as an OnPropertiesLink.
|
QL |
atLeast(int minSourceCardinality)
Replaces the minimum cardinality of all instances of this query link in the source expression
tree with the new values.
|
QL |
atMost(int maxSourceCardinality)
Replaces the maximum cardinality of all instances of this query link in the source expression
tree with the new value.
|
QL |
exactly(int sourceCardinality)
Replaces the minimum cardinality of all instances of this query link in the source expression
tree with the new value.
|
QueryNode |
getFromNode()
Deprecated.
use
sourceNode() . |
QueryNode |
getToNode()
Deprecated.
use
targetNode() . |
String |
name()
The name of this link in the query definition it belongs to.
|
QueryLinkType |
queryLinkType()
The link type.
|
QL |
restrictToSelfLinks()
Sets the self link filter to "restrict to self links" mode.
|
SelfLinkFilter |
selfLinkFilter()
Returns the self link filter.
|
QL |
setSelfLinkFilter(SelfLinkFilter selfLinkMode)
Sets the self link filter.
|
int |
sourceMaxCardinality()
Returns the maximum of all of the maximum cardinalities set for this query link in the source expression tree.
|
int |
sourceMinCardinality()
Returns the minimum of all of the minimum cardinalities set for this query link in the source expression tree.
|
QueryNode |
sourceNode()
Returns the node the link of this link comes from.
|
int |
targetMaxCardinality()
Returns the maximum of all of the maximum cardinalities set for this query link in the target expression tree.
|
int |
targetMinCardinality()
Returns the minimum of all of the minimum cardinalities set for this query link in the target expression tree.
|
QueryNode |
targetNode()
Returns the node the link of this link goes to.
|
QL |
withName(String name)
Sets the name of this link.
Setting the name does not change any bind-by-name resource (non-query definition resources) to match the new name. Changing the name changes the #hashCode of this object. |
QL |
withoutSelfLinks()
Sets the self link filter to "restrict to non-self links" mode.
|
QL |
withSourceCardinality(int minimumCardinality,
int maximumCardinality)
Replaces the cardinality of all instances of this query link in the source expression tree
with the new values.
|
QL |
withTargetCardinality(int minimumCardinality,
int maximumCardinality)
Replaces the cardinality of all the instances of this query link in the target expression tree
with the new values.
|
invisible, isInvisible
static final int UNBOUNDED
String name()
withName(String)
QL withName(String name)
#hashCode
of this object.name()
@Deprecated QueryNode getFromNode()
sourceNode()
.QueryNode sourceNode()
@Deprecated QueryNode getToNode()
targetNode()
.QueryNode targetNode()
QL withSourceCardinality(int minimumCardinality, int maximumCardinality)
minimumCardinality
- the minimum number of links.maximumCardinality
- the maximum number of links.QL withTargetCardinality(int minimumCardinality, int maximumCardinality)
minimumCardinality
- the minimum number of links.maximumCardinality
- the maximum number of links.int sourceMinCardinality()
int sourceMaxCardinality()
int targetMinCardinality()
int targetMaxCardinality()
QL atLeast(int minSourceCardinality)
minSourceCardinality
- the minimum number of links.QL atMost(int maxSourceCardinality)
maxSourceCardinality
- the maximum number of links.QL exactly(int sourceCardinality)
SourceCardinality
- the minimum number of links.QueryLinkType queryLinkType()
DirectLink asDirectLink() throws ClassCastException
queryLinkType()
is not QueryLinkType.DIRECT_LINK
, a class cast exception is thrown.ClassCastException
IndirectLink asIndirectLink() throws ClassCastException
queryLinkType()
is not QueryLinkType.INDIRECT_LINK
, a class cast exception is thrown.ClassCastException
OnPropertiesLink asOnPropertiesLink() throws ClassCastException
queryLinkType()
is not QueryLinkType.ON_PROPERTIES_LINK
, a class cast exception is thrown.ClassCastException
QL restrictToSelfLinks()
QL withoutSelfLinks()
QL setSelfLinkFilter(SelfLinkFilter selfLinkMode)
SelfLinkFilter selfLinkFilter()
setSelfLinkFilter(SelfLinkFilter)
Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.