2 * Copyright (c) 2013 Cisco Systems, Inc. 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.controller.sal.binding.model.api.type.builder;
10 import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
13 * Generated Transfer Object Builder is interface that contains methods to build
14 * and instantiate Generated Transfer Object definition.
16 * @see GeneratedTransferObject
18 public interface GeneratedTOBuilder extends GeneratedTypeBuilder {
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}
30 * Generated Transfer Object
32 public void setExtendsType(final GeneratedTransferObject genTransObj);
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}
42 * @return <code>new</code> instance of Generated Property Builder.
44 public GeneratedPropertyBuilder addProperty(final String name);
47 * Check whether GeneratedTOBuilder contains property with name
51 * of property which existance is checked
52 * @return true if property <code>name</code> exists in list of properties.
54 public boolean containsProperty(final String name);
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}
62 * Generated Property Builder
63 * @return <code>true</code> if addition of Generated Property into list of
64 * <code>equals</code> properties is successful.
66 public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);
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}
74 * Generated Property Builder
75 * @return <code>true</code> if addition of Generated Property into list of
76 * <code>hashCode</code> properties is successful.
78 public boolean addHashIdentity(final GeneratedPropertyBuilder property);
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}
86 * Generated Property Builder
87 * @return <code>true</code> if addition of Generated Property into list of
88 * <code>toString</code> properties is successful.
90 public boolean addToStringProperty(final GeneratedPropertyBuilder property);
93 public GeneratedTransferObject toInstance();
96 * Set original YANG type for GeneratedTOBuilder. It is YANG type from which
97 * is this transport object created.
100 * YangType enum value of original YANG type
102 public void setIsUnion(boolean isUnion);