@FunctionalInterface
public interface AttributePredicate
| Modifier and Type | Field | Description |
|---|---|---|
static AttributePredicate |
ANY_ATTRIBUTE |
An attribute predicate that always returns
true. |
static AttributePredicate |
IS_EMPTY_ATTRIBUTE |
An attribute predicate that returns
true when an attribute value is null or empty. |
static AttributePredicate |
IS_NOT_EMPTY_ATTRIBUTE |
An attribute predicate that returns
true when an attribute value is neither null nor empty. |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accepts(Element element,
java.lang.String name,
java.lang.String value) |
Returns
true when the attribute must be kept. |
default AttributePredicate |
and(AttributePredicate other) |
Returns a predicate that is the logical
and combination of this one and another one. |
static AttributePredicate |
fromNames(java.util.Collection<java.lang.String> names) |
Returns an AttributePredicate that returns true when the attribute has a names belonging to a collection.
|
static AttributePredicate |
fromPaths(java.util.Collection<SPath> paths) |
|
default AttributePredicate |
not() |
|
default AttributePredicate |
or(AttributePredicate other) |
Returns a predicate that is the logical
or combination of this one and another one. |
static final AttributePredicate ANY_ATTRIBUTE
true.static final AttributePredicate IS_EMPTY_ATTRIBUTE
true when an attribute value is null or empty.static final AttributePredicate IS_NOT_EMPTY_ATTRIBUTE
true when an attribute value is neither null nor empty.boolean accepts(Element element, java.lang.String name, java.lang.String value)
true when the attribute must be kept.element - The element containing the attribute.name - The attribute name.value - The attribute value.default AttributePredicate not()
default AttributePredicate and(AttributePredicate other)
and combination of this one and another one.other - The other predicate.and combination of this one and other.java.lang.IllegalArgumentException - When other is null.default AttributePredicate or(AttributePredicate other)
or combination of this one and another one.other - The other predicate.or combination of this one and other.java.lang.IllegalArgumentException - When other is null.static AttributePredicate fromNames(java.util.Collection<java.lang.String> names)
It is advised to use an efficient collection, typically a Set.
names - The collections of names. MUST NOT be null.java.lang.IllegalArgumentException - When names is null.static AttributePredicate fromPaths(java.util.Collection<SPath> paths)
Copyright © 2019. All rights reserved.