BUG-4268: clarify length constraint API contract
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / StringTypeDefinition.java
1 /*
2  * Copyright (c) 2013 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.yangtools.yang.model.api.type;
9
10 import java.util.List;
11 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
12
13 /**
14  *
15  * Contains method for getting data from the <code>string</code> YANG built-in
16  * type.
17  */
18 public interface StringTypeDefinition extends TypeDefinition<StringTypeDefinition> {
19
20     /**
21      * Returns length constraint specified in the string. These are the effective constraints, e.g. they include
22      * any length constraints implied by base types.
23      *
24      * @return list of length constraint which are specified in the
25      *         <code>length</code> substatement of the <code>type</code>
26      *         statement
27      */
28     List<LengthConstraint> getLengthConstraints();
29
30     /**
31      * Returns patterns specified in the string.
32      *
33      * @return list of pattern constraints which are specified in the
34      *         <code>pattern</code> substatement of the <code>type</code>
35      *         statement
36      */
37     List<PatternConstraint> getPatternConstraints();
38 }