2 * Copyright (c) 2017 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.api.type;
10 import java.util.Optional;
11 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
14 * Interface for {@link TypeDefinition}s which can have their values restricted to a set of allowed lengths.
16 * @param <T> Concrete {@link TypeDefinition} subinterface
18 public interface LengthRestrictedTypeDefinition<T extends TypeDefinition<T>> extends TypeDefinition<T> {
20 * Returns length constraint of this type, if applicable. This is the effective constraint, e.g. it includes any
21 * length constraints implied by base type hierarchy.
23 * @return length constraint which are specified in the <code>length</code> substatement of the <code>type</code>
26 Optional<LengthConstraint> getLengthConstraint();