BUG-1485: deprecate length/range methods
authorRobert Varga <rovarga@cisco.com>
Wed, 18 Mar 2015 17:20:15 +0000 (18:20 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 13 Apr 2015 08:25:59 +0000 (10:25 +0200)
These methods leak the internals of how constraints are enforced. No
outside parties should rely on them, so lets mark them deprecated. If we
do not get reports of use, we should be removing them in a future
release.

Change-Id: I128c5abe5c894a4808ff30dcebd6af42d8f682cb
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/ClassTemplate.xtend

index 28c2f0dcea03243fe32d9e1694c50d30fb9cbc70..cc3a78809a8215943b3f82a2469f8f54ed705313 100644 (file)
@@ -165,6 +165,10 @@ class ClassTemplate extends BaseTemplate {
     def private generateLengthMethod(String methodName, String varName) '''
         «IF restrictions != null && !(restrictions.lengthConstraints.empty)»
             «val numberClass = restrictions.lengthConstraints.iterator.next.min.class»
+            /**
+             * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+             */
+            @Deprecated
             public static «List.importedName»<«Range.importedName»<«numberClass.importedNumber»>> «methodName»() {
                 return «varName»;
             }
@@ -174,6 +178,10 @@ class ClassTemplate extends BaseTemplate {
     def private generateRangeMethod(String methodName, String varName) '''
         «IF restrictions != null && !(restrictions.rangeConstraints.empty)»
             «val returnType = allProperties.iterator.next.returnType»
+            /**
+             * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+             */
+            @Deprecated
             public static «List.importedName»<«Range.importedName»<«returnType.importedNumber»>> «methodName»() {
                 return «varName»;
             }