Class IfFeatureExpr
- java.lang.Object
-
- org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureExpr
-
@Beta public abstract class IfFeatureExpr extends Object implements Immutable, Predicate<Set<QName>>
A resolvedif-feature
expression, implementing aPredicate
. 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, likePredicate.and(Predicate)
are not optimized in this implementation.The set of features referenced in this expression is available through
getReferencedFeatures()
.- Author:
- Robert Varga
-
-
Constructor Summary
Constructors Constructor Description IfFeatureExpr()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static @NonNull IfFeatureExpr
and(Set<IfFeatureExpr> exprs)
Construct a intersection (logicalAND
) expression of specified expressions.abstract boolean
equals(Object obj)
abstract @NonNull Set<QName>
getReferencedFeatures()
Returns the set of allfeature
s referenced by this expression.abstract int
hashCode()
static @NonNull IfFeatureExpr
isPresent(QName qname)
Construct an assertion that a feature is present in the set passed totest(Set)
.abstract @NonNull IfFeatureExpr
negate()
static @NonNull IfFeatureExpr
or(Set<IfFeatureExpr> exprs)
Construct a union (logicalOR
) expression of specified expressions.abstract boolean
test(Set<QName> supportedFeatures)
abstract String
toString()
-
-
-
Method Detail
-
isPresent
public static final @NonNull IfFeatureExpr isPresent(QName qname)
Construct an assertion that a feature is present in the set passed totest(Set)
.- Parameters:
qname
- Feature QName- Returns:
- An expression
- Throws:
NullPointerException
- ifqname
is null
-
and
public static final @NonNull IfFeatureExpr and(Set<IfFeatureExpr> exprs)
Construct a intersection (logicalAND
) expression of specified expressions.- Parameters:
exprs
- Constituent expressions- Returns:
- An expression
- Throws:
NullPointerException
- ifexprs
or any of its members is nullIllegalArgumentException
- ifexprs
is empty
-
or
public static final @NonNull IfFeatureExpr or(Set<IfFeatureExpr> exprs)
Construct a union (logicalOR
) expression of specified expressions.- Parameters:
exprs
- Constituent expressions- Returns:
- An expression
- Throws:
NullPointerException
- ifexprs
or any of its members is nullIllegalArgumentException
- ifexprs
is empty
-
getReferencedFeatures
public abstract @NonNull Set<QName> 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
public abstract @NonNull IfFeatureExpr negate()
-
-