Adjust to yangtools-2.0.0 changes
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / java / api / generator / classTemplateRestrictions.scala.txt
index 07e01edc263d21140c9469e934f20e199a326a8f..0ce3e665358f3b35a9722fa42c43ee16b615635d 100644 (file)
 
 @(currentType: Type, paramName: String, returnType: Type, rangeGenerator: AbstractRangeGenerator[_])
 @if(getRestrictions(currentType) != null) {
-    @if(!getRestrictions(currentType).getLengthConstraints.isEmpty || !getRestrictions(currentType).getRangeConstraints.isEmpty) {
+    @if(getRestrictions(currentType).getLengthConstraint.isPresent || getRestrictions(currentType).getRangeConstraint.isPresent) {
     if (@{paramName} != null) {
-        @if(!getRestrictions(currentType).getLengthConstraints.isEmpty) {
+        @if(getRestrictions(currentType).getLengthConstraint.isPresent) {
             @{LengthGenerator.generateLengthCheckerCall(paramName, paramValue(returnType, paramName))}
         }
-        @if(!getRestrictions(currentType).getRangeConstraints.isEmpty) {
+        @if(getRestrictions(currentType).getRangeConstraint.isPresent) {
             @{rangeGenerator.generateRangeCheckerCall(paramName, paramValue(returnType, paramName))}
         }
     }
     }
-}
\ No newline at end of file
+}