Fix checkstyle in mdsal-binding2-generator-util
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / java / org / opendaylight / mdsal / binding / javav2 / java / api / generator / rangeGenerators / Uint64RangeGenerator.java
1 /*
2  * Copyright (c) 2017 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.javav2.java.api.generator.rangeGenerators;
9
10 import com.google.common.primitives.UnsignedLong;
11 import java.math.BigInteger;
12 import org.opendaylight.yangtools.yang.common.Uint64;
13
14 final class Uint64RangeGenerator extends AbstractUnsignedIntegerRangeGenerator<Uint64> {
15     Uint64RangeGenerator() {
16         super(Uint64.class, Uint64.class.getName(), Uint64.valueOf(0), Uint64.fromUnsignedLong(
17             UnsignedLong.fromLongBits(0xffffffffffffffffL)));
18     }
19
20     @Override
21     protected Uint64 convert(final Number value) {
22         return Uint64.valueOf(BigInteger.class.cast(value));
23     }
24 }