b4fafbf84b60d46770043a88888b91f2381085bd
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / type / builder / GeneratedTOBuilder.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;\r
9 \r
10 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedTransferObject;\r
11 \r
12 /**\r
13  * Generated Transfer Object Builder is interface that contains methods to build\r
14  * and instantiate Generated Transfer Object definition.\r
15  * \r
16  * @see GeneratedTransferObject\r
17  */\r
18 public interface GeneratedTOBuilder extends GeneratedTypeBuilder {\r
19 \r
20     /**\r
21      * Add Generated Transfer Object from which will be extended current\r
22      * Generated Transfer Object. <br>\r
23      * By definition Java does not allow multiple inheritance, hence if there is\r
24      * already definition of Generated Transfer Object the extending object will\r
25      * be overwritten by lastly added Generated Transfer Object. <br>\r
26      * If Generated Transfer Object is <code>null</code> the method SHOULD throw\r
27      * {@link IllegalArgumentException}\r
28      * \r
29      * @param genTransObj\r
30      *            Generated Transfer Object\r
31      */\r
32     public void setExtendsType(final GeneratedTransferObject genTransObj);\r
33 \r
34     /**\r
35      * Add Property that will be part of <code>equals</code> definition. <br>\r
36      * If Generated Property Builder is <code>null</code> the method SHOULD\r
37      * throw {@link IllegalArgumentException}\r
38      * \r
39      * @param property\r
40      *            Generated Property Builder\r
41      * @return <code>true</code> if addition of Generated Property into list of\r
42      *         <code>equals</code> properties is successful.\r
43      */\r
44     public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);\r
45 \r
46     /**\r
47      * Add Property that will be part of <code>hashCode</code> definition. <br>\r
48      * If Generated Property Builder is <code>null</code> the method SHOULD\r
49      * throw {@link IllegalArgumentException}\r
50      * \r
51      * @param property\r
52      *            Generated Property Builder\r
53      * @return <code>true</code> if addition of Generated Property into list of\r
54      *         <code>hashCode</code> properties is successful.\r
55      */\r
56     public boolean addHashIdentity(final GeneratedPropertyBuilder property);\r
57 \r
58     /**\r
59      * Add Property that will be part of <code>toString</code> definition. <br>\r
60      * If Generated Property Builder is <code>null</code> the method SHOULD\r
61      * throw {@link IllegalArgumentException}\r
62      * \r
63      * @param property\r
64      *            Generated Property Builder\r
65      * @return <code>true</code> if addition of Generated Property into list of\r
66      *         <code>toString</code> properties is successful.\r
67      */\r
68     public boolean addToStringProperty(final GeneratedPropertyBuilder property);\r
69 \r
70     @Override\r
71     public GeneratedTransferObject toInstance();\r
72 \r
73     /**\r
74      * Set original YANG type for GeneratedTOBuilder. It is YANG type from which\r
75      * is this transport object created.\r
76      * \r
77      * @param yangType\r
78      *            YangType enum value of original YANG type\r
79      */\r
80     public void setIsUnion(boolean isUnion);\r
81 }\r