Squash empty lists/maps
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / mdsal / binding / model / api / MethodSignature.java
index b6cb410b36a967ee398d8dd15306148a70705787..dafcfe4e3f3fe89a72725e4437f175f340af1ae4 100644 (file)
@@ -47,6 +47,13 @@ public interface MethodSignature extends TypeMember {
      */
     List<Parameter> getParameters();
 
+    /**
+     * Return the mechanics associated with this method.
+     *
+     * @return Associated mechanics
+     */
+    ValueMechanics getMechanics();
+
     /**
      * The Parameter interface is designed to hold the information of method
      * Parameter(s). The parameter is defined by his Name which MUST be unique
@@ -69,4 +76,20 @@ public interface MethodSignature extends TypeMember {
          */
         Type getType();
     }
+
+    /**
+     * Method return type mechanics. This is a bit of an escape hatch for various behaviors which are supported by
+     * code generation.
+     */
+    enum ValueMechanics {
+        /**
+         * Usual mechanics, nothing special is going on.
+         */
+        NORMAL,
+        /**
+         * Mechanics signaling that the method should not be returning empty collections, but rather squash tham
+         * to null.
+         */
+        NULLIFY_EMPTY,
+    }
 }