610992690b6d7a002cb0e31c1764df3da04ae72e
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / mdsal / binding / model / api / type / builder / GeneratedPropertyBuilder.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.mdsal.binding.model.api.type.builder;
9
10 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
11 import org.opendaylight.mdsal.binding.model.api.Type;
12
13 /**
14  * Generated Property Builder is interface that contains methods to build and
15  * instantiate Generated Property definition.
16  *
17  * @see GeneratedProperty
18  */
19 public interface GeneratedPropertyBuilder extends TypeMemberBuilder<GeneratedPropertyBuilder> {
20
21     GeneratedPropertyBuilder setValue(String value);
22
23     /**
24      * Sets isReadOnly flag for property. If property is marked as read only it
25      * is the same as set property in java as final.
26      *
27      * @param isReadOnly
28      *            Read Only property flag.
29      */
30     GeneratedPropertyBuilder setReadOnly(final boolean isReadOnly);
31
32     /**
33      * Returns <code>new</code> <i>immutable</i> instance of Generated Property. <br>
34      * The <code>definingType</code> param cannot be <code>null</code>. The
35      * every member in Java MUST be declared and defined inside the scope of
36      * <code>class</code> definition. In case that defining Type will be passed
37      * as <code>null</code> reference the method SHOULD thrown
38      * {@link IllegalArgumentException}.
39      *
40      * @param definingType
41      *            Defining Type of Generated Property
42      * @return <code>new</code> <i>immutable</i> instance of Generated Property.
43      */
44     GeneratedProperty toInstance(final Type definingType);
45 }