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 / Uint32RangeGenerator.java
diff --git a/binding2/mdsal-binding2-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/javav2/java/api/generator/rangeGenerators/Uint32RangeGenerator.java b/binding2/mdsal-binding2-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/javav2/java/api/generator/rangeGenerators/Uint32RangeGenerator.java
new file mode 100644 (file)
index 0000000..06e1e85
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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.Uint32;
+
+final class Uint32RangeGenerator extends AbstractUnsignedIntegerRangeGenerator<Uint32> {
+    Uint32RangeGenerator() {
+        super(Uint32.class, Uint32.class.getName(), Uint32.valueOf(0),
+            Uint32.valueOf(0xffffffffL));
+    }
+
+    @Override
+    protected Uint32 convert(final Number value) {
+        return Uint32.valueOf(value.longValue());
+    }
+}
\ No newline at end of file