import org.opendaylight.yangtools.yang.binding.ChildOf;
import org.opendaylight.yangtools.yang.binding.ChoiceIn;
import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Identifier;
import org.opendaylight.yangtools.yang.binding.TypeObject;
import org.opendaylight.yangtools.yang.common.Empty;
import org.opendaylight.yangtools.yang.common.Uint16;
<C extends ChoiceIn<? super T> & DataObject, N extends ChildOf<? super C>>
@NonNull MatchBuilderPath<O, N> extractChild(Class<C> caseClass, Class<N> childClass);
+ /**
+ * Add a child path component to the specification of what needs to be extracted, specifying an exact match in
+ * a keyed list. This method, along with its alternatives, can be used to specify which object type to select from
+ * the root path.
+ *
+ * @param <N> List type
+ * @param <K> Key type
+ * @param listKey List key
+ * @return This builder
+ * @throws NullPointerException if childClass is null
+ */
+ <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.
*
@FunctionalInterface
public interface LeafReference<P, C> extends Serializable {
/**
- * Dummy method to express the method signature of a typical getter. This method
+ * Dummy method to express the method signature of a typical getter. Due to this match we can match any Java
+ * method reference which takes in {@code parent} and results in {@code child} -- expose the feature of using
+ * {@code Parent::getChild} method shorthand.
*
* @param parent Parent object
* @return Leaf value
* @deprecated This method is present only for technical realization of taking the method reference and should
- * never be involved directly.
+ * never be involved directly. See {@code LambdaDecoder} for gory details.
*/
@Deprecated(forRemoval = true)
C dummyMethod(P parent);
}
+ @FunctionalInterface
+ public interface BooleanLeafReference<P> extends LeafReference<P, Boolean> {
+
+ }
+
@FunctionalInterface
public interface EmptyLeafReference<P> extends LeafReference<P, Empty> {