09823823630f7b4ca9e52b57d8c0c4886b099fca
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / Builders.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.data.impl.schema;
9
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.schema.*;
12 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
14 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
15 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.ListNodeBuilder;
16 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
17 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.*;
18 import org.opendaylight.yangtools.yang.model.api.*;
19
20 public class Builders {
21
22     public static <T> NormalizedNodeBuilder<InstanceIdentifier.NodeIdentifier, T, LeafNode<T>> leafBuilder() {
23         return ImmutableLeafNodeBuilder.create();
24     }
25
26     public static <T> NormalizedNodeBuilder<InstanceIdentifier.NodeIdentifier, T, LeafNode<T>> leafBuilder(
27             LeafSchemaNode schema) {
28         return ImmutableLeafNodeSchemaAwareBuilder.create(schema);
29     }
30
31     public static <T> NormalizedNodeBuilder<InstanceIdentifier.NodeWithValue, T, LeafSetEntryNode<T>> leafSetEntryBuilder() {
32         return ImmutableLeafSetEntryNodeBuilder.create();
33     }
34
35     public static <T> NormalizedNodeBuilder<InstanceIdentifier.NodeWithValue, T, LeafSetEntryNode<T>> leafSetEntryBuilder(
36             LeafListSchemaNode schema) {
37         return ImmutableLeafSetEntryNodeSchemaAwareBuilder.create(schema);
38     }
39
40     public static <T> ListNodeBuilder<T, LeafSetEntryNode<T>> leafSetBuilder() {
41         return ImmutableLeafSetNodeBuilder.create();
42     }
43
44     public static <T> ListNodeBuilder<T, LeafSetEntryNode<T>> leafSetBuilder(LeafListSchemaNode schema) {
45         return ImmutableLeafSetNodeSchemaAwareBuilder.create(schema);
46     }
47
48     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ContainerNode> containerBuilder() {
49         return ImmutableContainerNodeBuilder.create();
50     }
51
52     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ContainerNode> containerBuilder(
53             ContainerSchemaNode schema) {
54         return ImmutableContainerNodeSchemaAwareBuilder.create(schema);
55     }
56
57     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> mapEntryBuilder() {
58         return ImmutableMapEntryNodeBuilder.create();
59     }
60
61     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> mapEntryBuilder(
62             ListSchemaNode schema) {
63         return ImmutableMapEntryNodeSchemaAwareBuilder.create(schema);
64     }
65
66     public static CollectionNodeBuilder<MapEntryNode, MapNode> mapBuilder() {
67         return ImmutableMapNodeBuilder.create();
68     }
69
70     public static CollectionNodeBuilder<MapEntryNode, MapNode> mapBuilder(ListSchemaNode schema) {
71         return ImmutableMapNodeSchemaAwareBuilder.create(schema);
72     }
73
74     public static DataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> augmentationBuilder() {
75         return ImmutableAugmentationNodeBuilder.create();
76     }
77
78     public static DataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> augmentationBuilder(AugmentationSchema schema) {
79         return ImmutableAugmentationNodeSchemaAwareBuilder.create(schema);
80     }
81
82     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> choiceBuilder() {
83         return ImmutableChoiceNodeBuilder.create();
84     }
85
86     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> choiceBuilder(org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) {
87         return ImmutableChoiceNodeSchemaAwareBuilder.create(schema);
88     }
89
90 }