summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
e861da0)
This is a notable omission from the interface, allow users to
target Boolean types.
JIRA: MDSAL-652
Change-Id: Ie62f6419bf3db57887797f7bc88f7ec5dfd5f203
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<N extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<N>>
@NonNull MatchBuilderPath<O, N> extractChild(Class<@NonNull N> listItem, K listKey);
<N extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<N>>
@NonNull MatchBuilderPath<O, N> extractChild(Class<@NonNull N> listItem, K listKey);
+ /**
+ * Match an {@code boolean} leaf's value.
+ *
+ * @param methodRef method reference to the getter method
+ * @return A {@link ValueMatchBuilder}
+ * @throws NullPointerException if methodRef is null
+ */
+ @NonNull ValueMatchBuilder<O, Boolean> leaf(BooleanLeafReference<T> methodRef);
+
/**
* Match an {@code empty} leaf's value.
*
/**
* Match an {@code empty} leaf's value.
*
C dummyMethod(P parent);
}
C dummyMethod(P parent);
}
+ @FunctionalInterface
+ public interface BooleanLeafReference<P> extends LeafReference<P, Boolean> {
+
+ }
+
@FunctionalInterface
public interface EmptyLeafReference<P> extends LeafReference<P, Empty> {
@FunctionalInterface
public interface EmptyLeafReference<P> extends LeafReference<P, Empty> {
import org.opendaylight.yang.gen.v1.mdsal.query.norev.first.grp.SystemKey;
import org.opendaylight.yang.gen.v1.mdsal.query.norev.second.grp.Alarms;
import org.opendaylight.yang.gen.v1.mdsal.query.norev.third.grp.AffectedUsers;
import org.opendaylight.yang.gen.v1.mdsal.query.norev.first.grp.SystemKey;
import org.opendaylight.yang.gen.v1.mdsal.query.norev.second.grp.Alarms;
import org.opendaylight.yang.gen.v1.mdsal.query.norev.third.grp.AffectedUsers;
+import org.opendaylight.yang.gen.v1.mdsal426.norev.BooleanCont;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint64;
.greaterThan(Uint64.TEN)
.build();
}
.greaterThan(Uint64.TEN)
.build();
}
+
+ public QueryExpression<BooleanCont> selectBoolean() {
+ return factory
+ .querySubtree(InstanceIdentifier.create(BooleanCont.class))
+ .matching()
+ .leaf(BooleanCont::getIsFoo)
+ .valueEquals(true)
+ .build();
+ }
return (MatchBuilderPath<O, N>) this;
}
return (MatchBuilderPath<O, N>) this;
}
+ @Override
+ public ValueMatchBuilder<O, Boolean> leaf(final BooleanLeafReference<T> methodRef) {
+ return defaultFor(methodRef);
+ }
+
@Override
public ValueMatchBuilder<O, Empty> leaf(final EmptyLeafReference<T> methodRef) {
return defaultFor(methodRef);
@Override
public ValueMatchBuilder<O, Empty> leaf(final EmptyLeafReference<T> methodRef) {
return defaultFor(methodRef);