Re-organize YANG snippet generation and comment confusion
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / mdsal / binding / model / api / type / builder / GeneratedTypeBuilderBase.java
index bf1272028940bab58f6caa8d305e245042e36998..f7ebe0bc793ba91b5670d11cf00e54bd980e164a 100644 (file)
@@ -8,8 +8,12 @@
 package org.opendaylight.mdsal.binding.model.api.type.builder;
 
 import java.util.List;
+import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.model.api.Constant;
 import org.opendaylight.mdsal.binding.model.api.Type;
+import org.opendaylight.mdsal.binding.model.api.TypeComment;
+import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition;
 import org.opendaylight.yangtools.yang.common.QName;
 
 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
@@ -52,13 +56,13 @@ public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
 
     /**
      * Adds String definition of comment into Method Signature definition. <br>
-     * The comment String MUST NOT contain anny comment specific chars (i.e.
+     * The comment String MUST NOT contain any comment specific chars (i.e.
      * "/**" or "//") just plain String text description.
      *
      * @param comment
      *            Comment String.
      */
-    T addComment(String comment);
+    T addComment(TypeComment comment);
 
     /**
      * The method creates new AnnotationTypeBuilder containing specified package
@@ -158,6 +162,13 @@ public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
 
     List<GeneratedPropertyBuilder> getProperties();
 
+    /**
+     * Returns the YANG definition of this type, if available.
+     *
+     * @return YANG source definition, or empty when unavailable.
+     */
+    Optional<YangSourceDefinition> getYangSourceDefinition();
+
     /**
      * Add new Generated Property definition for Generated Transfer Object
      * Builder and returns Generated Property Builder for specifying Property. <br>
@@ -218,4 +229,10 @@ public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
      */
     void setReference(String reference);
 
+    /**
+     * Set the YANG source definition.
+     *
+     * @param definition YANG source definition, must not be null
+     */
+    void setYangSourceDefinition(@NonNull YangSourceDefinition definition);
 }