MDSAL-320 Mapping type collisions between yang built-in uint* and int*
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / java / org / opendaylight / mdsal / binding / javav2 / java / api / generator / rangeGenerators / Uint16RangeGenerator.java
diff --git a/binding2/mdsal-binding2-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/javav2/java/api/generator/rangeGenerators/Uint16RangeGenerator.java b/binding2/mdsal-binding2-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/javav2/java/api/generator/rangeGenerators/Uint16RangeGenerator.java
new file mode 100644 (file)
index 0000000..230c03b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2017 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.mdsal.binding.javav2.java.api.generator.rangeGenerators;
+
+import org.opendaylight.yangtools.yang.common.Uint16;
+
+final class Uint16RangeGenerator extends AbstractUnsignedIntegerRangeGenerator<Uint16> {
+    Uint16RangeGenerator() {
+        super(Uint16.class, Uint16.class.getName(), Uint16.valueOf(0), Uint16.valueOf(65535));
+    }
+
+    @Override
+    protected Uint16 convert(final Number value) {
+        return Uint16.valueOf(value.intValue());
+    }
+}
\ No newline at end of file