Merge "OF plugin classes must have a strict dependency on Connection Service"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / type / builder / GeneratedTOBuilder.java
index ff55fe5f12cbfbe3428848fcdf7d859cc84a2e29..d6cc2f55d6344fbb643d34cd799c612f310df431 100644 (file)
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.binding.model.api.type.builder;\r
-\r
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;\r
-import org.opendaylight.controller.sal.binding.model.api.Type;\r
-\r
-/**\r
-\r
- *\r
- */\r
-public interface GeneratedTOBuilder extends Type {\r
-\r
-    public EnumBuilder addEnumeration(final String name);\r
-\r
-    public GeneratedPropertyBuilder addProperty(final String name);\r
-\r
-    public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);\r
-\r
-    public boolean addHashIdentity(final GeneratedPropertyBuilder property);\r
-\r
-    public boolean addToStringProperty(final GeneratedPropertyBuilder property);\r
-\r
-    public GeneratedTransferObject toInstance();\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.binding.model.api.type.builder;
+
+import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
+
+/**
+ * Generated Transfer Object Builder is interface that contains methods to build
+ * and instantiate Generated Transfer Object definition.
+ * 
+ * @see GeneratedTransferObject
+ */
+public interface GeneratedTOBuilder extends GeneratedTypeBuilder {
+
+    /**
+     * Add Generated Transfer Object from which will be extended current
+     * Generated Transfer Object. <br>
+     * By definition Java does not allow multiple inheritance, hence if there is
+     * already definition of Generated Transfer Object the extending object will
+     * be overwritten by lastly added Generated Transfer Object. <br>
+     * If Generated Transfer Object is <code>null</code> the method SHOULD throw
+     * {@link IllegalArgumentException}
+     * 
+     * @param genTransObj
+     *            Generated Transfer Object
+     */
+    public void setExtendsType(final GeneratedTransferObject genTransObj);
+
+    /**
+     * Add new Generated Property definition for Generated Transfer Object
+     * Builder and returns Generated Property Builder for specifying Property. <br>
+     * Name of Property cannot be <code>null</code>, if it is <code>null</code>
+     * the method SHOULD throw {@link IllegalArgumentException}
+     * 
+     * @param name
+     *            Name of Property
+     * @return <code>new</code> instance of Generated Property Builder.
+     */
+    public GeneratedPropertyBuilder addProperty(final String name);
+
+    /**
+     * Check whether GeneratedTOBuilder contains property with name
+     * <code>name</code>
+     * 
+     * @param name
+     *            of property which existance is checked
+     * @return true if property <code>name</code> exists in list of properties.
+     */
+    public boolean containsProperty(final String name);
+
+    /**
+     * Add Property that will be part of <code>equals</code> definition. <br>
+     * If Generated Property Builder is <code>null</code> the method SHOULD
+     * throw {@link IllegalArgumentException}
+     * 
+     * @param property
+     *            Generated Property Builder
+     * @return <code>true</code> if addition of Generated Property into list of
+     *         <code>equals</code> properties is successful.
+     */
+    public boolean addEqualsIdentity(final GeneratedPropertyBuilder property);
+
+    /**
+     * Add Property that will be part of <code>hashCode</code> definition. <br>
+     * If Generated Property Builder is <code>null</code> the method SHOULD
+     * throw {@link IllegalArgumentException}
+     * 
+     * @param property
+     *            Generated Property Builder
+     * @return <code>true</code> if addition of Generated Property into list of
+     *         <code>hashCode</code> properties is successful.
+     */
+    public boolean addHashIdentity(final GeneratedPropertyBuilder property);
+
+    /**
+     * Add Property that will be part of <code>toString</code> definition. <br>
+     * If Generated Property Builder is <code>null</code> the method SHOULD
+     * throw {@link IllegalArgumentException}
+     * 
+     * @param property
+     *            Generated Property Builder
+     * @return <code>true</code> if addition of Generated Property into list of
+     *         <code>toString</code> properties is successful.
+     */
+    public boolean addToStringProperty(final GeneratedPropertyBuilder property);
+
+    @Override
+    public GeneratedTransferObject toInstance();
+
+    /**
+     * Set original YANG type for GeneratedTOBuilder. It is YANG type from which
+     * is this transport object created.
+     * 
+     * @param yangType
+     *            YangType enum value of original YANG type
+     */
+    public void setIsUnion(boolean isUnion);
+}