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
14 * build 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.
24 * By definition Java does not allow multiple
25 * inheritance, hence if there is already definition of Generated
26 * Transfer Object the extending object will be overwritten by lastly
27 * added Generated Transfer Object.
29 * If Generated Transfer Object is <code>null</code> the method SHOULD
30 * throw {@link IllegalArgumentException}
32 * @param genTransObj Generated Transfer Object
34 public void setExtendsType(final GeneratedTransferObject genTransObj);
37 * Add new Generated Property definition for Generated Transfer Object
38 * Builder and returns Generated Property Builder for specifying Property.
40 * Name of Property cannot be <code>null</code>,
41 * if it is <code>null</code> the method SHOULD throw {@link IllegalArgumentException}
43 * @param name Name of Property
44 * @return <code>new</code> instance of Generated Property Builder.
46 public GeneratedPropertyBuilder addProperty(final String name);
49 * Add Property that will be part of <code>equals</code> definition.
51 * If Generated Property Builder is <code>null</code> the method SHOULD
52 * throw {@link IllegalArgumentException}
54 * @param property Generated Property Builder
55 * @return <code>true</code> if addition of Generated Property into list
56 * of <code>equals</code> properties is successful.
58 public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);
61 * Add Property that will be part of <code>hashCode</code> definition.
63 * If Generated Property Builder is <code>null</code> the method SHOULD
64 * throw {@link IllegalArgumentException}
66 * @param property Generated Property Builder
67 * @return <code>true</code> if addition of Generated Property into list
68 * of <code>hashCode</code> properties is successful.
70 public boolean addHashIdentity(final GeneratedPropertyBuilder property);
73 * Add Property that will be part of <code>toString</code> definition.
75 * If Generated Property Builder is <code>null</code> the method SHOULD
76 * throw {@link IllegalArgumentException}
78 * @param property Generated Property Builder
79 * @return <code>true</code> if addition of Generated Property into list
80 * of <code>toString</code> properties is successful.
82 public boolean addToStringProperty(final GeneratedPropertyBuilder property);
85 public GeneratedTransferObject toInstance();