Merge "OF plugin classes must have a strict dependency on Connection Service"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / type / builder / GeneratedTOBuilder.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.controller.sal.binding.model.api.type.builder;
9
10 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
11
12 /**
13  * Generated Transfer Object Builder is interface that contains methods to build
14  * and instantiate Generated Transfer Object definition.
15  * 
16  * @see GeneratedTransferObject
17  */
18 public interface GeneratedTOBuilder extends GeneratedTypeBuilder {
19
20     /**
21      * Add Generated Transfer Object from which will be extended current
22      * Generated Transfer Object. <br>
23      * By definition Java does not allow multiple inheritance, hence if there is
24      * already definition of Generated Transfer Object the extending object will
25      * be overwritten by lastly added Generated Transfer Object. <br>
26      * If Generated Transfer Object is <code>null</code> the method SHOULD throw
27      * {@link IllegalArgumentException}
28      * 
29      * @param genTransObj
30      *            Generated Transfer Object
31      */
32     public void setExtendsType(final GeneratedTransferObject genTransObj);
33
34     /**
35      * Add new Generated Property definition for Generated Transfer Object
36      * Builder and returns Generated Property Builder for specifying Property. <br>
37      * Name of Property cannot be <code>null</code>, if it is <code>null</code>
38      * the method SHOULD throw {@link IllegalArgumentException}
39      * 
40      * @param name
41      *            Name of Property
42      * @return <code>new</code> instance of Generated Property Builder.
43      */
44     public GeneratedPropertyBuilder addProperty(final String name);
45
46     /**
47      * Check whether GeneratedTOBuilder contains property with name
48      * <code>name</code>
49      * 
50      * @param name
51      *            of property which existance is checked
52      * @return true if property <code>name</code> exists in list of properties.
53      */
54     public boolean containsProperty(final String name);
55
56     /**
57      * Add Property that will be part of <code>equals</code> definition. <br>
58      * If Generated Property Builder is <code>null</code> the method SHOULD
59      * throw {@link IllegalArgumentException}
60      * 
61      * @param property
62      *            Generated Property Builder
63      * @return <code>true</code> if addition of Generated Property into list of
64      *         <code>equals</code> properties is successful.
65      */
66     public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);
67
68     /**
69      * Add Property that will be part of <code>hashCode</code> definition. <br>
70      * If Generated Property Builder is <code>null</code> the method SHOULD
71      * throw {@link IllegalArgumentException}
72      * 
73      * @param property
74      *            Generated Property Builder
75      * @return <code>true</code> if addition of Generated Property into list of
76      *         <code>hashCode</code> properties is successful.
77      */
78     public boolean addHashIdentity(final GeneratedPropertyBuilder property);
79
80     /**
81      * Add Property that will be part of <code>toString</code> definition. <br>
82      * If Generated Property Builder is <code>null</code> the method SHOULD
83      * throw {@link IllegalArgumentException}
84      * 
85      * @param property
86      *            Generated Property Builder
87      * @return <code>true</code> if addition of Generated Property into list of
88      *         <code>toString</code> properties is successful.
89      */
90     public boolean addToStringProperty(final GeneratedPropertyBuilder property);
91
92     @Override
93     public GeneratedTransferObject toInstance();
94
95     /**
96      * Set original YANG type for GeneratedTOBuilder. It is YANG type from which
97      * is this transport object created.
98      * 
99      * @param yangType
100      *            YangType enum value of original YANG type
101      */
102     public void setIsUnion(boolean isUnion);
103 }