Fix checkstyle
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / query / MatchBuilderPath.java
index 66c2f5ac664dea1b5d7a8fe600cdc7d07dd6d78d..3a6266121059e7cee8bd3a25d01df3a252aa727e 100644 (file)
@@ -15,7 +15,10 @@ import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 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.Decimal64;
 import org.opendaylight.yangtools.yang.common.Empty;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -46,6 +49,38 @@ public interface MatchBuilderPath<O extends DataObject, T extends DataObject> ex
     <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 decimal64} leaf's value.
+     *
+     * @param methodRef method reference to the getter method
+     * @return A {@link ValueMatchBuilder}
+     * @throws NullPointerException if methodRef is null
+     */
+    @NonNull ComparableMatchBuilder<O, Decimal64> leaf(Decimal64LeafReference<T> methodRef);
+
     /**
      * Match an {@code empty} leaf's value.
      *
@@ -167,76 +202,88 @@ public interface MatchBuilderPath<O extends DataObject, T extends DataObject> ex
      * @param <C> Child type
      */
     @FunctionalInterface
-    public interface LeafReference<P, C> extends Serializable {
+    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 EmptyLeafReference<P> extends LeafReference<P, Empty> {
+    interface BooleanLeafReference<P> extends LeafReference<P, Boolean> {
+
+    }
+
+    @FunctionalInterface
+    interface Decimal64LeafReference<P> extends LeafReference<P, Decimal64> {
+
+    }
+
+    @FunctionalInterface
+    interface EmptyLeafReference<P> extends LeafReference<P, Empty> {
 
     }
 
     @FunctionalInterface
-    public interface StringLeafReference<P> extends LeafReference<P, String> {
+    interface StringLeafReference<P> extends LeafReference<P, String> {
 
     }
 
     @FunctionalInterface
-    public interface Int8LeafReference<P> extends LeafReference<P, Byte> {
+    interface Int8LeafReference<P> extends LeafReference<P, Byte> {
 
     }
 
     @FunctionalInterface
-    public interface Int16LeafReference<P> extends LeafReference<P, Short> {
+    interface Int16LeafReference<P> extends LeafReference<P, Short> {
 
     }
 
     @FunctionalInterface
-    public interface Int32LeafReference<P> extends LeafReference<P, Integer> {
+    interface Int32LeafReference<P> extends LeafReference<P, Integer> {
 
     }
 
     @FunctionalInterface
-    public interface Int64LeafReference<P> extends LeafReference<P, Long> {
+    interface Int64LeafReference<P> extends LeafReference<P, Long> {
 
     }
 
     @FunctionalInterface
-    public interface Uint8LeafReference<P> extends LeafReference<P, Uint8> {
+    interface Uint8LeafReference<P> extends LeafReference<P, Uint8> {
 
     }
 
     @FunctionalInterface
-    public interface Uint16LeafReference<P> extends LeafReference<P, Uint16> {
+    interface Uint16LeafReference<P> extends LeafReference<P, Uint16> {
 
     }
 
     @FunctionalInterface
-    public interface Uint32LeafReference<P> extends LeafReference<P, Uint32> {
+    interface Uint32LeafReference<P> extends LeafReference<P, Uint32> {
 
     }
 
     @FunctionalInterface
-    public interface Uint64LeafReference<P> extends LeafReference<P, Uint64> {
+    interface Uint64LeafReference<P> extends LeafReference<P, Uint64> {
 
     }
 
     @FunctionalInterface
-    public interface IdentityLeafReference<P, T extends BaseIdentity> extends LeafReference<P, T> {
+    interface IdentityLeafReference<P, T extends BaseIdentity> extends LeafReference<P, T> {
 
     }
 
     @FunctionalInterface
-    public interface TypeObjectLeafReference<P, T extends TypeObject> extends LeafReference<P, T> {
+    interface TypeObjectLeafReference<P, T extends TypeObject> extends LeafReference<P, T> {
 
     }
 }