2 * Copyright (c) 2015 Pantheon Technologies s.r.o. 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
8 package org.opendaylight.yangtools.yang.model.util.type;
10 import com.google.common.collect.ImmutableRangeSet;
11 import com.google.common.collect.Range;
12 import com.google.common.collect.RangeSet;
13 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
15 final class JavaLengthConstraints {
16 private JavaLengthConstraints() {
17 throw new UnsupportedOperationException();
20 private static final RangeSet<Integer> INTEGER_ALLOWED_RANGES =
21 ImmutableRangeSet.of(Range.closed(0, Integer.MAX_VALUE));
23 static final LengthConstraint INTEGER_SIZE_CONSTRAINTS = new LengthConstraint() {
25 public String getReference() {
30 public String getErrorMessage() {
35 public String getErrorAppTag() {
40 public String getDescription() {
45 public RangeSet<Integer> getAllowedRanges() {
46 return INTEGER_ALLOWED_RANGES;