2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.yangtools.yang.data.impl.codec;
11 import java.math.BigInteger;
12 import java.util.Objects;
13 import java.util.Optional;
14 import org.opendaylight.yangtools.yang.data.api.codec.Uint64Codec;
15 import org.opendaylight.yangtools.yang.model.api.type.Uint64TypeDefinition;
17 final class Uint64StringCodec extends AbstractIntegerStringCodec<BigInteger, Uint64TypeDefinition> implements
20 Uint64StringCodec(final Optional<Uint64TypeDefinition> typeDef) {
21 super(typeDef, extractRange(typeDef.orElse(null)), BigInteger.class);
25 BigInteger deserialize(final String stringRepresentation, final int base) {
26 return new BigInteger(stringRepresentation, base);
30 public String serialize(final BigInteger data) {
31 return Objects.toString(data, "");