@* * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html *@ @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.getRestrictions @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.paramValue @import org.opendaylight.mdsal.binding.javav2.java.api.generator.rangeGenerators.AbstractRangeGenerator @import org.opendaylight.mdsal.binding.javav2.java.api.generator.rangeGenerators.LengthGenerator @import org.opendaylight.mdsal.binding.javav2.model.api.Type @(currentType: Type, paramName: String, returnType: Type, rangeGenerator: AbstractRangeGenerator[_]) @if(getRestrictions(currentType) != null) { @if(!getRestrictions(currentType).getLengthConstraints.isEmpty || !getRestrictions(currentType).getRangeConstraints.isEmpty) { if (@{paramName} != null) { @if(!getRestrictions(currentType).getLengthConstraints.isEmpty) { @{LengthGenerator.generateLengthCheckerCall(paramName, paramValue(returnType, paramName))} } @if(!getRestrictions(currentType).getRangeConstraints.isEmpty) { @{rangeGenerator.generateRangeCheckerCall(paramName, paramValue(returnType, paramName))} } } } }