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