+/*
+ * Copyright (c) 2014 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
+ */
package org.opendaylight.yangtools.sal.java.api.generator\r
\r
import java.util.List\r
'''\r
\r
def private generateGetLength() '''\r
+ «IF restrictions != null && !(restrictions.lengthConstraints.empty)»\r
+ public static «List.importedName»<«Range.importedName»<Integer>> getLength() {\r
+ final «List.importedName»<«Range.importedName»<Integer>> result = new «ArrayList.importedName»<>();\r
+ «FOR r : restrictions.lengthConstraints»\r
+ result.add(«Range.importedName».closed(«r.min», «r.max»));\r
+ «ENDFOR»\r
+ return result;\r
+ }\r
+ «ENDIF»\r
+ '''\r
+\r
+ def private generateGetRange() '''\r
«IF restrictions != null && !(restrictions.lengthConstraints.empty)»\r
public static «List.importedName»<«Range.importedName»<Integer>> getLength() {\r
final «List.importedName»<«Range.importedName»<Integer>> result = new «ArrayList.importedName»<>();\r