Enable checkstyle in yang-model-util
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / type / NumberUtil.java
index 424d416a95601a935faaeef3291183478bd7bff5..0899ed9abad53366689de63505e6a3a9e6a97da4 100644 (file)
@@ -38,6 +38,7 @@ final class NumberUtil {
     };
 
     private static final Map<Class<? extends Number>, Function<Number, Number>> CONVERTERS;
+
     static {
         final ImmutableMap.Builder<Class<? extends Number>, Function<Number, Number>> b = ImmutableMap.builder();
         b.put(Byte.class, input -> {
@@ -48,14 +49,14 @@ final class NumberUtil {
             return Byte.valueOf(input.toString());
         });
         b.put(Short.class, input -> {
-                if (input instanceof Short) {
-                    return input;
-                }
-                if (input instanceof Byte) {
-                    return input.shortValue();
-                }
+            if (input instanceof Short) {
+                return input;
+            }
+            if (input instanceof Byte) {
+                return input.shortValue();
+            }
 
-                return Short.valueOf(input.toString());
+            return Short.valueOf(input.toString());
         });
         b.put(Integer.class, input -> {
             if (input instanceof Integer) {
@@ -81,8 +82,7 @@ final class NumberUtil {
             if (input instanceof BigDecimal) {
                 return input;
             }
-            if (input instanceof Byte || input instanceof Short ||
-                    input instanceof Integer || input instanceof Long) {
+            if (input instanceof Byte || input instanceof Short || input instanceof Integer || input instanceof Long) {
                 return BigDecimal.valueOf(input.longValue());
             }
 
@@ -92,8 +92,7 @@ final class NumberUtil {
             if (input instanceof BigInteger) {
                 return input;
             }
-            if (input instanceof Byte || input instanceof Short ||
-                    input instanceof Integer || input instanceof Long) {
+            if (input instanceof Byte || input instanceof Short || input instanceof Integer || input instanceof Long) {
                 return BigInteger.valueOf(input.longValue());
             }
 
@@ -111,7 +110,7 @@ final class NumberUtil {
     }
 
     static boolean isRangeCovered(final Number min, final Number max, final Number superMin, final Number superMax) {
-        return NumberUtil.NUMBER_COMPARATOR.compare(min, superMin) >= 0 &&
-                NumberUtil.NUMBER_COMPARATOR.compare(max, superMax) <= 0;
+        return NumberUtil.NUMBER_COMPARATOR.compare(min, superMin) >= 0
+            && NumberUtil.NUMBER_COMPARATOR.compare(max, superMax) <= 0;
     }
 }