Class IfFeatureExpr
java.lang.Object
org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureExpr
- All Implemented Interfaces:
Predicate<FeatureSet>
,Immutable
public abstract sealed class IfFeatureExpr
extends Object
implements Immutable, Predicate<FeatureSet>
A resolved
if-feature
expression, implementing a Predicate
. Internal representation is that of
a tree of expressions, optimized for memory usage. negate()
performs an efficient logical negation without
relying on default predicate methods. Other Predicate methods, like Predicate.and(Predicate)
are not optimized in
this implementation.
The set of features referenced in this expression is available through getReferencedFeatures()
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final @NonNull IfFeatureExpr
and
(Set<IfFeatureExpr> exprs) Construct a intersection (logicalAND
) expression of specified expressions.abstract boolean
Returns the set of allfeature
s referenced by this expression.abstract int
hashCode()
static final @NonNull IfFeatureExpr
Construct an assertion that a feature is present in the set passed totest(FeatureSet)
.abstract @NonNull IfFeatureExpr
negate()
static final @NonNull IfFeatureExpr
or
(Set<IfFeatureExpr> exprs) Construct a union (logicalOR
) expression of specified expressions.abstract boolean
test
(FeatureSet supportedFeatures) abstract String
toString()
-
Constructor Details
-
IfFeatureExpr
public IfFeatureExpr()
-
-
Method Details
-
isPresent
Construct an assertion that a feature is present in the set passed totest(FeatureSet)
.- Parameters:
qname
- Feature QName- Returns:
- An expression
- Throws:
NullPointerException
- ifqname
isnull
-
and
Construct a intersection (logicalAND
) expression of specified expressions.- Parameters:
exprs
- Constituent expressions- Returns:
- An expression
- Throws:
NullPointerException
- ifexprs
or any of its members isnull
IllegalArgumentException
- ifexprs
is empty
-
or
Construct a union (logicalOR
) expression of specified expressions.- Parameters:
exprs
- Constituent expressions- Returns:
- An expression
- Throws:
NullPointerException
- ifexprs
or any of its members isnull
IllegalArgumentException
- ifexprs
is empty
-
getReferencedFeatures
Returns the set of allfeature
s referenced by this expression. Each feature is identified by its QName.- Returns:
- The set of referenced features. Mutability of the returned Set and order of features is undefined.
-
negate
- Specified by:
negate
in interfacePredicate<FeatureSet>
-
test
- Specified by:
test
in interfacePredicate<FeatureSet>
-
hashCode
public abstract int hashCode() -
equals
-
toString
-