From 0db9dcbd819534969248551fcc8e810a6e9e2d97 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 11 Oct 2018 14:09:40 +0200 Subject: [PATCH] Enable checkstyle in mdsal-binding-generator-api This fixes a few violations and flips enforcement on. Change-Id: Id55c011e8a7f5e85e678aefe793e6aba585ee083 Signed-off-by: Robert Varga --- binding/mdsal-binding-generator-api/pom.xml | 12 ++ .../spi/BindingGeneratorServiceProvider.java | 2 +- .../binding/model/api/AnnotationType.java | 50 +++--- .../binding/model/api/CodeGenerator.java | 22 +-- .../mdsal/binding/model/api/Enumeration.java | 11 +- .../model/api/GeneratedTransferObject.java | 51 +++--- .../binding/model/api/GeneratedType.java | 53 +++---- .../mdsal/binding/model/api/JavaTypeName.java | 2 +- .../binding/model/api/ParameterizedType.java | 12 +- .../mdsal/binding/model/api/Restrictions.java | 4 +- .../mdsal/binding/model/api/WildcardType.java | 4 +- .../type/builder/AnnotableTypeBuilder.java | 2 +- .../type/builder/AnnotationTypeBuilder.java | 31 ++-- .../api/type/builder/ConstantBuilder.java | 2 +- .../model/api/type/builder/EnumBuilder.java | 6 +- .../builder/GeneratedPropertyBuilder.java | 17 +- .../api/type/builder/GeneratedTOBuilder.java | 43 +++-- .../builder/GeneratedTypeBuilderBase.java | 149 +++++++----------- .../type/builder/MethodSignatureBuilder.java | 18 +-- .../api/type/builder/TypeMemberBuilder.java | 16 +- 20 files changed, 202 insertions(+), 305 deletions(-) diff --git a/binding/mdsal-binding-generator-api/pom.xml b/binding/mdsal-binding-generator-api/pom.xml index 1722660710..e729332c22 100644 --- a/binding/mdsal-binding-generator-api/pom.xml +++ b/binding/mdsal-binding-generator-api/pom.xml @@ -30,4 +30,16 @@ yang-binding + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + checkstyle.violationSeverity=error + + + + diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java index 654868659a..558e005d0f 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/generator/spi/BindingGeneratorServiceProvider.java @@ -9,5 +9,5 @@ package org.opendaylight.mdsal.binding.generator.spi; public interface BindingGeneratorServiceProvider { - void registerTypeProvider(final TypeProvider provider); + void registerTypeProvider(TypeProvider provider); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java index 186ee675af..11c5983baf 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/AnnotationType.java @@ -10,32 +10,27 @@ package org.opendaylight.mdsal.binding.model.api; import java.util.List; /** - * The Annotation Type interface is designed to hold information about - * annotation for any type that could be annotated in Java.
- * For sake of simplicity the Annotation Type is not designed to model exact - * behaviour of annotation mechanism, but just to hold information needed to - * model annotation over java Type definition. + * The Annotation Type interface is designed to hold information about annotation for any type that could be annotated + * in Java.
+ * For sake of simplicity the Annotation Type is not designed to model exact behaviour of annotation mechanism, + * but just to hold information needed to model annotation over java Type definition. */ public interface AnnotationType extends Type { - /** - * Returns the List of Annotations.
- * Each Annotation Type MAY have defined multiple Annotations. + * Returns the List of Annotations. Each Annotation Type MAY have defined multiple Annotations. * * @return the List of Annotations. */ List getAnnotations(); /** - * Returns Parameter Definition assigned for given parameter name.
- * If Annotation does not contain parameter with specified param name, the - * method MAY return null value. + * Returns Parameter Definition assigned for given parameter name. If Annotation does not contain parameter + * with specified param name, the method MAY return null value. * - * @param paramName - * Parameter Name + * @param paramName Parameter Name * @return Parameter Definition assigned for given parameter name. */ - Parameter getParameter(final String paramName); + Parameter getParameter(String paramName); /** * Returns List of all parameters assigned to Annotation Type. @@ -59,18 +54,13 @@ public interface AnnotationType extends Type { boolean containsParameters(); /** - * Annotation Type parameter interface. For simplicity the Parameter - * contains values and value types as Strings. Every annotation which - * contains parameters could contain either single parameter or array of - * parameters. To model this purposes the by contract if the parameter - * contains single parameter the {@link #getValues()} method will return - * empty List and {@link #getValue()} MUST always return non- - * null parameter. If the Parameter holds List of values the - * singular {@link #getValue()} parameter MAY return null - * value. + * Annotation Type parameter interface. For simplicity the Parameter contains values and value types as Strings. + * Every annotation which contains parameters could contain either single parameter or array of parameters. To model + * this purposes the by contract if the parameter contains single parameter the {@link #getValues()} method will + * return empty List and {@link #getValue()} MUST always return non-null parameter. If the Parameter + * holds List of values the singular {@link #getValue()} parameter MAY return null value. */ interface Parameter { - /** * Returns the Name of the parameter. * @@ -79,21 +69,17 @@ public interface AnnotationType extends Type { String getName(); /** - * Returns value in String format if Parameter contains singular value, - * otherwise MAY return null. + * Returns value in String format if Parameter contains singular value, otherwise MAY return null. * * @return value in String format if Parameter contains singular value. */ String getValue(); /** - * Returns List of Parameter assigned values in order in which they were - * assigned for given parameter name.
- * If there are multiple values assigned for given parameter name the - * method MUST NOT return empty List. + * Returns List of Parameter assigned values in order in which they were assigned for given parameter name.
+ * If there are multiple values assigned for given parameter name the method MUST NOT return empty List. * - * @return List of Parameter assigned values in order in which they were - * assigned for given parameter name. + * @return List of Parameter assigned values in order in which they were assigned for given parameter name. */ List getValues(); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java index 3e1923f266..7096d5239a 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/CodeGenerator.java @@ -8,29 +8,23 @@ package org.opendaylight.mdsal.binding.model.api; /** - * Transformates virtual data to the concrete code in programming language. + * Transforms virtual data to the concrete code in programming language. */ public interface CodeGenerator { - /** * Generates code for type. * - * @param type - * Input type to be processed + * @param type Input type to be processed * @return generated JAVA code */ String generate(Type type); /** - * Checks if the concrete instance of type fit to concrete - * implementation of this interface. - * - * (e. g. method return true if in EnumGenerator (which - * implements this interface) has input parameter of type Enumeration (which - * is subtype of Type) + * Checks if the concrete instance of type fit to concrete implementation of this interface (e.g. + * method return true if in EnumGenerator (which implements this interface) has input parameter of type + * Enumeration (which is subtype of Type). * - * @param type - * Input type to be processed + * @param type Input type to be processed * @return true if type is acceptable for processing. */ boolean isAcceptable(Type type); @@ -38,10 +32,8 @@ public interface CodeGenerator { /** * Returns name of type parameter. * - * @param type - * Input type to be processed + * @param type Input type to be processed * @return name of generated unit */ String getUnitName(Type type); - } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java index df76cfff6e..270c146802 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Enumeration.java @@ -14,13 +14,10 @@ import org.opendaylight.yangtools.yang.model.api.DocumentedNode; * Interface provide methods for reading data of enumeration class. */ public interface Enumeration extends GeneratedType { - /** - * * Returns list of annotation definitions associated with enumeration type. * * @return list of annotation definitions associated with enumeration type. - * */ @Override List getAnnotations(); @@ -43,15 +40,13 @@ public interface Enumeration extends GeneratedType { String toFormattedString(); /** - * Interface is used for reading enumeration item. It means item's name and - * its value. + * Interface is used for reading enumeration item. It means item's name and its value. */ interface Pair extends DocumentedNode.WithStatus { - /** - * Returns the name of the enumeration item as it is specified in the input yang. + * Returns the name of the enumeration item as it is specified in the input YANG. * - * @return the name of the enumeration item as it is specified in the input yang. + * @return the name of the enumeration item as it is specified in the input YANG. */ String getName(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java index 264447ab0a..50994f4d16 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedTransferObject.java @@ -11,73 +11,60 @@ import java.util.List; import org.opendaylight.yangtools.yang.model.api.TypeDefinition; /** - * Generated Transfer Object extends {@link GeneratedType} and is designed to - * represent Java Class. The Generated Transfer Object contains declarations of - * member fields stored in List of Properties. The Generated Transfer Object can - * be extended by exactly ONE Generated Transfer Object as Java don't allow - * multiple inheritance. For retrieval of implementing Generated Types use - * {@link #getImplements()} method.
- * Every transfer object SHOULD contain equals, hashCode and toString - * definitions. For this purpose retrieve definitions through - * {@link #getEqualsIdentifiers ()}, {@link #getHashCodeIdentifiers()} and - * {@link #getToStringIdentifiers ()}. + * Generated Transfer Object extends {@link GeneratedType} and is designed to represent Java Class. The Generated + * Transfer Object contains declarations of member fields stored in List of Properties. The Generated Transfer Object + * can be extended by exactly ONE Generated Transfer Object as Java does not allow multiple inheritance. For retrieval + * of implementing Generated Types use {@link #getImplements()} method.
+ * Every transfer object SHOULD contain equals, hashCode and toString definitions. For this purpose retrieve definitions + * through {@link #getEqualsIdentifiers ()}, {@link #getHashCodeIdentifiers()} and + * {@link #getToStringIdentifiers()}. */ public interface GeneratedTransferObject extends GeneratedType { GeneratedProperty getSUID(); /** - * Returns the Generated Transfer Object from which this GTO is derived, or - * null if this GTO is not derived from a GTO -- e.g. it is either an union - * or it is derived from a concrete type. + * Returns the Generated Transfer Object from which this GTO is derived, or null if this GTO is not derived + * from a GTO -- e.g. it is either an union or it is derived from a concrete type. * - * @return Generated Transfer Object or null if this GTO is - * not derived from another GTO. + * @return Generated Transfer Object or null if this GTO is not derived from another GTO. */ GeneratedTransferObject getSuperType(); /** - * Returns List of Properties that are designated to define equality for - * Generated Transfer Object. + * Returns List of Properties that are designated to define equality for Generated Transfer Object. * - * @return List of Properties that are designated to define equality for - * Generated Transfer Object. + * @return List of Properties that are designated to define equality for Generated Transfer Object. */ List getEqualsIdentifiers(); /** - * Returns List of Properties that are designated to define identity for - * Generated Transfer Object. + * Returns List of Properties that are designated to define identity for Generated Transfer Object. * - * @return List of Properties that are designated to define identity for - * Generated Transfer Object. + * @return List of Properties that are designated to define identity for Generated Transfer Object. */ List getHashCodeIdentifiers(); /** - * Returns List of Properties that will be members of toString definition - * for Generated Transfer Object. + * Returns List of Properties that will be members of toString definition for Generated Transfer Object. * - * @return List of Properties that will be members of toString definition - * for Generated Transfer Object. + * @return List of Properties that will be members of toString definition for Generated Transfer Object. */ List getToStringIdentifiers(); boolean isTypedef(); /** - * Returns Base type of Java representation of YANG typedef if set, otherwise it returns null + * Returns Base type of Java representation of YANG typedef if set, otherwise it returns null. * * @return Base type of Java representation of YANG typedef if set, otherwise it returns null */ TypeDefinition getBaseType(); /** - * Return boolean value which describe whether Generated Transfer Object - * was/wasn't created from union YANG type. + * Return boolean value which describe whether Generated Transfer Object was created (or not) from union YANG type. * - * @return true value if Generated Transfer Object was created from union - * YANG type. + * @return true value if Generated Transfer Object was created from union YANG type. */ boolean isUnionType(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java index 0f0bd8684e..bf74e5c61b 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/GeneratedType.java @@ -14,34 +14,26 @@ import java.util.Optional; * Every Java interface has to be specified with: *
    *
  • package that belongs into
  • - *
  • interface name (with commentary that SHOULD be - * present to proper define interface and base contracts specified for - * interface)
  • - *
  • Each Generated Type can define list of types that Generated Type can - * implement to extend it's definition (i.e. interface extends list of - * interfaces or java class implements list of interfaces)
  • - *
  • Each Generated Type can contain multiple enclosed definitions of - * Generated Types (i.e. interface can contain N enclosed interface definitions - * or enclosed classes)
  • - *
  • enum and constant definitions (i.e. each - * constant definition is by default defined as public static final - * + type (either primitive or object) and constant name
  • - *
  • method definitions with specified input parameters (with - * types) and return values
  • + *
  • interface name (with commentary that SHOULD be present to proper define interface and base + * contracts specified for interface)
  • + *
  • Each Generated Type can define list of types that Generated Type can implement to extend it's definition + * (i.e. interface extends list of interfaces or java class implements list of interfaces)
  • + *
  • Each Generated Type can contain multiple enclosed definitions of Generated Types (i.e. interface can contain N + * enclosed interface definitions or enclosed classes)
  • + *
  • enum and constant definitions (i.e. each constant definition is by default defined + * as public static final + type (either primitive or object) and constant name
  • + *
  • method definitions with specified input parameters (with types) and return values
  • *
* - * By the definition of the interface constant, enum, enclosed types and method - * definitions MUST be public, so there is no need to specify the scope of - * visibility. + *

+ * By the definition of the interface constant, enum, enclosed types and method definitions MUST be public, so there is + * no need to specify the scope of visibility. */ public interface GeneratedType extends Type, DocumentedType { - /** - * Returns the parent type if Generated Type is defined as enclosing type, - * otherwise returns null + * Returns the parent type if Generated Type is defined as enclosing type, otherwise returns null. * - * @return the parent type if Generated Type is defined as enclosing type, - * otherwise returns null + * @return the parent type if Generated Type is defined as enclosing type, otherwise returns null */ Type getParentType(); @@ -81,11 +73,9 @@ public interface GeneratedType extends Type, DocumentedType { List getEnclosedTypes(); /** - * Returns List of all Enumerator definitions associated with Generated - * Type. + * Returns List of all Enumerator definitions associated with Generated Type. * - * @return List of all Enumerator definitions associated with Generated - * Type. + * @return List of all Enumerator definitions associated with Generated Type. */ List getEnumerations(); @@ -97,20 +87,17 @@ public interface GeneratedType extends Type, DocumentedType { List getConstantDefinitions(); /** - * Returns List of Method Definitions associated with Generated Type. - * - * List does not contains getters and setters for properties. + * Returns List of Method Definitions associated with Generated Type. The list does not contains getters and setters + * for properties. * * @return List of Method Definitions associated with Generated Type. */ List getMethodDefinitions(); /** - * Returns List of Properties that are declared for Generated Transfer - * Object. + * Returns List of Properties that are declared for Generated Transfer Object. * - * @return List of Properties that are declared for Generated Transfer - * Object. + * @return List of Properties that are declared for Generated Transfer Object. */ List getProperties(); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/JavaTypeName.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/JavaTypeName.java index 7893682303..555bc426f2 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/JavaTypeName.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/JavaTypeName.java @@ -265,7 +265,7 @@ public abstract class JavaTypeName implements Identifier, Immutable { * @throws IllegalArgumentException if the simpleName is empty * @throws UnsupportedOperationException if this type name does not support nested type */ - public abstract boolean canCreateEnclosed(final String simpleName); + public abstract boolean canCreateEnclosed(String simpleName); /** * Create a TypeName for a class immediately enclosed by this class. diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java index 42735256e3..7a56993166 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/ParameterizedType.java @@ -8,20 +8,16 @@ package org.opendaylight.mdsal.binding.model.api; /** - * Represents an instance of simple parametrized type such as List<String>. - * - * The parametrized Type is designed to be used to store information of Java - * Generic Type. The array of {@link #getActualTypeArguments()} holds + * Represents an instance of simple parameterized type such as List<String>. The parameterized Type is designed + * to be used to store information of Java Generic Type. The array of {@link #getActualTypeArguments()} holds * information of all generic parameters defined for Parameterized Type. */ public interface ParameterizedType extends Type { - /** * Returns array of Types that are defined for Parameterized Type. *
- * (for example if ParameterizedType encapsulates java generic Map that - * specifies two parameters Map<K,V> and the K is java.lang.Integer and V - * is defined as GeneratedType the array will contain two Types to store + * (for example if ParameterizedType encapsulates java generic Map that specifies two parameters Map<K,V> + * and the K is java.lang.Integer and V is defined as GeneratedType the array will contain two Types to store * the information of generic parameters.) * * @return array of Types that are defined for Parameterized Type. diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java index 00de43d385..b6a85dba96 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/Restrictions.java @@ -16,8 +16,10 @@ import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint; public interface Restrictions { Optional getLengthConstraint(); + List getPatternConstraints(); + Optional> getRangeConstraint(); - boolean isEmpty(); + boolean isEmpty(); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java index ad95a5a215..40b603843c 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/WildcardType.java @@ -8,9 +8,7 @@ package org.opendaylight.mdsal.binding.model.api; /** - * - * Marker interface which assign to object property that it is bounded wildcard - * type. + * Marker interface which assign to object property that it is a bounded wildcard type. */ public interface WildcardType extends Type { diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotableTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotableTypeBuilder.java index d1d3be06fe..370f810357 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotableTypeBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotableTypeBuilder.java @@ -21,7 +21,7 @@ public interface AnnotableTypeBuilder { * @param identifier JavaTypeName of the annotation * @return a new instance of Annotation Type Builder. */ - AnnotationTypeBuilder addAnnotation(final JavaTypeName identifier); + AnnotationTypeBuilder addAnnotation(JavaTypeName identifier); /** * The method creates new {@link AnnotationTypeBuilder} containing specified package name an annotation name. diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java index 429c19d254..3a5e4b6cd4 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/AnnotationTypeBuilder.java @@ -22,7 +22,6 @@ import org.opendaylight.yangtools.concepts.Builder; * @see AnnotationType */ public interface AnnotationTypeBuilder extends Type, Builder { - /** * The method creates new AnnotationTypeBuilder containing specified package * name an annotation name.
@@ -30,13 +29,11 @@ public interface AnnotationTypeBuilder extends Type, Builder { * references. In case that any of parameters contains null the * method SHOULD thrown {@link IllegalArgumentException} * - * @param packageName - * Package Name of Annotation Type - * @param name - * Name of Annotation Type + * @param packageName Package Name of Annotation Type + * @param name Name of Annotation Type * @return new instance of Annotation Type Builder. */ - AnnotationTypeBuilder addAnnotation(final String packageName, final String name); + AnnotationTypeBuilder addAnnotation(String packageName, String name); /** * Adds the parameter into List of parameters for Annotation Type.
@@ -47,14 +44,11 @@ public interface AnnotationTypeBuilder extends Type, Builder { * In case that any of parameters contains null the method * SHOULD thrown {@link IllegalArgumentException} * - * @param paramName - * Parameter Name - * @param value - * Parameter Value - * @return true if the parameter has been successfully assigned - * for Annotation Type + * @param paramName Parameter Name + * @param value Parameter Value + * @return true if the parameter has been successfully assigned for Annotation Type */ - boolean addParameter(final String paramName, String value); + boolean addParameter(String paramName, String value); /** * Adds the parameter with specified List of parameter values into List of @@ -66,14 +60,11 @@ public interface AnnotationTypeBuilder extends Type, Builder { * In case that any of parameters contains null the method * SHOULD thrown {@link IllegalArgumentException} * - * @param paramName - * Parameter Name - * @param values - * List of Values bounded to Parameter Name - * @return true if the parameter has been successfully assigned - * for Annotation Type + * @param paramName Parameter Name + * @param values List of Values bounded to Parameter Name + * @return true if the parameter has been successfully assigned for Annotation Type */ - boolean addParameters(final String paramName, List values); + boolean addParameters(String paramName, List values); /** * Returns new immutable instance of Annotation Type diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java index 0e955dfd2d..52af4456eb 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/ConstantBuilder.java @@ -12,7 +12,7 @@ import org.opendaylight.mdsal.binding.model.api.Type; public interface ConstantBuilder { - void assignValue(final Object value); + void assignValue(Object value); Constant toInstance(Type definingType); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java index 88eb12c859..1815a09046 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/EnumBuilder.java @@ -18,9 +18,9 @@ import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition; */ public interface EnumBuilder extends Type, AnnotableTypeBuilder { - void setDescription(final String description); + void setDescription(String description); - Enumeration toInstance(final Type definingType); + Enumeration toInstance(Type definingType); /** * Updates this builder with data from enumTypeDef. Specifically this data represents list @@ -28,5 +28,5 @@ public interface EnumBuilder extends Type, AnnotableTypeBuilder { * * @param enumTypeDef enum type definition as source of enum data for enumBuilder */ - void updateEnumPairsFromEnumTypeDef(final EnumTypeDefinition enumTypeDef); + void updateEnumPairsFromEnumTypeDef(EnumTypeDefinition enumTypeDef); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java index 610992690b..114e37b651 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedPropertyBuilder.java @@ -11,8 +11,7 @@ import org.opendaylight.mdsal.binding.model.api.GeneratedProperty; import org.opendaylight.mdsal.binding.model.api.Type; /** - * Generated Property Builder is interface that contains methods to build and - * instantiate Generated Property definition. + * Generated Property Builder is interface that contains methods to build and instantiate Generated Property definition. * * @see GeneratedProperty */ @@ -21,13 +20,12 @@ public interface GeneratedPropertyBuilder extends TypeMemberBuildernew immutable instance of Generated Property.
@@ -37,9 +35,8 @@ public interface GeneratedPropertyBuilder extends TypeMemberBuildernull reference the method SHOULD thrown * {@link IllegalArgumentException}. * - * @param definingType - * Defining Type of Generated Property + * @param definingType Defining Type of Generated Property * @return new immutable instance of Generated Property. */ - GeneratedProperty toInstance(final Type definingType); + GeneratedProperty toInstance(Type definingType); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java index a604022987..b032d16f1f 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTOBuilder.java @@ -22,58 +22,51 @@ public interface GeneratedTOBuilder extends GeneratedTypeBuilderBase { /** - * Add Generated Transfer Object from which will be extended current - * Generated Transfer Object.
- * 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.
- * If Generated Transfer Object is null the method SHOULD throw - * {@link IllegalArgumentException} + * Add Generated Transfer Object from which will be extended current Generated Transfer Object.
+ * By definition Java does not allow multiple inheritance, hence if there is already a definition + * of an Generated Transfer Object the extending object will be overwritten by lastly added Generated Transfer + * Object.
+ * If Generated Transfer Object is null the method SHOULD throw {@link IllegalArgumentException} * - * @param genTransObj - * Generated Transfer Object + * @param genTransObj Generated Transfer Object * @return This instance of builder */ - GeneratedTOBuilder setExtendsType(final GeneratedTransferObject genTransObj); + GeneratedTOBuilder setExtendsType(GeneratedTransferObject genTransObj); /** * Add Property that will be part of equals definition.
* If Generated Property Builder is null the method SHOULD * throw {@link IllegalArgumentException} * - * @param property - * Generated Property Builder + * @param property Generated Property Builder * @return This instance of builder */ - GeneratedTOBuilder addEqualsIdentity(final GeneratedPropertyBuilder property); + GeneratedTOBuilder addEqualsIdentity(GeneratedPropertyBuilder property); /** * Add Property that will be part of hashCode definition.
* If Generated Property Builder is null the method SHOULD * throw {@link IllegalArgumentException} * - * @param property - * Generated Property Builder + * @param property Generated Property Builder * @return This instance of builder */ - GeneratedTOBuilder addHashIdentity(final GeneratedPropertyBuilder property); + GeneratedTOBuilder addHashIdentity(GeneratedPropertyBuilder property); /** * Add Property that will be part of toString definition.
* If Generated Property Builder is null the method SHOULD * throw {@link IllegalArgumentException} * - * @param property - * Generated Property Builder + * @param property Generated Property Builder * @return This instance of builder */ - GeneratedTOBuilder addToStringProperty(final GeneratedPropertyBuilder property); + GeneratedTOBuilder addToStringProperty(GeneratedPropertyBuilder property); void setRestrictions(Restrictions restrictions); /** - * Returns instance of GeneratedTransferObject which data are - * build from the data of this builder + * Returns instance of GeneratedTransferObject which data are build from the data of this builder. * * @return generated transfer object instance */ @@ -83,18 +76,18 @@ public interface GeneratedTOBuilder extends GeneratedTypeBuilderBase typeDef); boolean isUnion(); /** + * Sets the union flag. * - * @param isUnion + * @param isUnion true if the result is a union type. */ void setIsUnion(boolean isUnion); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java index d07c63a6d6..646175b5cc 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/GeneratedTypeBuilderBase.java @@ -17,61 +17,50 @@ import org.opendaylight.mdsal.binding.model.api.YangSourceDefinition; import org.opendaylight.yangtools.yang.model.api.SchemaPath; public interface GeneratedTypeBuilderBase> extends Type, AnnotableTypeBuilder { - /** - * Adds new Enclosing Transfer Object into definition of Generated Type and - * returns new Instance of Generated TO Builder.
- * There is no need of specifying of Package Name because enclosing Type is - * already defined inside Generated Type with specific package name.
- * The name of enclosing Type cannot be same as Name of parent type and if - * there is already defined enclosing type with the same name, the new - * enclosing type will simply overwrite the older definition.
- * If the name of enclosing type is null the method SHOULD - * throw {@link IllegalArgumentException} + * Adds new Enclosing Transfer Object into definition of Generated Type and returns new Instance + * of Generated TO Builder.
+ * There is no need of specifying of Package Name because enclosing Type is already defined inside Generated Type + * with specific package name.
+ * The name of enclosing Type cannot be same as Name of parent type and if there is already defined enclosing type + * with the same name, the new enclosing type will simply overwrite the older definition.
+ * If the name of enclosing type is null the method SHOULD throw {@link IllegalArgumentException}. * - * @param name - * Name of Enclosing Type + * @param name Name of Enclosing Type * @return new Instance of Generated Type Builder. */ GeneratedTOBuilder addEnclosingTransferObject(String name); /** - * Adds new Enclosing Transfer Object genTOBuilder into - * definition of Generated Type + * Adds new Enclosing Transfer Object genTOBuilder into definition of Generated Type. * *
- * There is no need of specifying of Package Name because enclosing Type is - * already defined inside Generated Type with specific package name.
- * The name of enclosing Type cannot be same as Name of parent type and if - * there is already defined enclosing type with the same name, the new - * enclosing type will simply overwrite the older definition.
- * If the parameter genTOBuilder of enclosing type is - * null the method SHOULD throw - * {@link IllegalArgumentException} - * - * @param genTOBuilder - * Name of Enclosing Type + * There is no need of specifying of Package Name because enclosing Type is already defined inside Generated Type + * with specific package name.
+ * The name of enclosing Type cannot be same as Name of parent type and if there is already defined enclosing type + * with the same name, the new enclosing type will simply overwrite the older definition.
+ * If the parameter genTOBuilder of enclosing type is null the method SHOULD throw + * {@link IllegalArgumentException}. + * + * @param genTOBuilder Name of Enclosing Type */ T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder); /** - * Adds String definition of comment into Method Signature definition.
- * The comment String MUST NOT contain any comment specific chars (i.e. - * "/**" or "//") just plain String text description. + * Adds String definition of comment into Method Signature definition.
+ * The comment String MUST NOT contain any comment specific chars (i.e. "/**" or "//") just plain String text + * description. * - * @param comment - * Comment String. + * @param comment Comment String. */ T addComment(TypeComment comment); boolean isAbstract(); /** - * Sets the abstract flag to define Generated Type as - * abstract type. + * Sets the abstract flag to define Generated Type as abstract type. * - * @param isAbstract - * abstract flag + * @param isAbstract abstract flag */ T setAbstract(boolean isAbstract); @@ -80,40 +69,33 @@ public interface GeneratedTypeBuilderBase> /** * Add Type to implements. * - * @param genType - * Type to implement + * @param genType Type to implement * @return true if the addition of type is successful. */ T addImplementsType(Type genType); /** - * Adds Constant definition and returns new Constant instance.
- * By definition Constant MUST be defined by return Type, Name and assigned - * value. The name SHOULD be defined with capital letters. Neither of method - * parameters can be null and the method SHOULD throw + * Adds Constant definition and returns new Constant instance.
+ * By definition Constant MUST be defined by return Type, Name and assigned value. The name SHOULD be defined + * with capital letters. Neither of method parameters can be null and the method SHOULD throw * {@link IllegalArgumentException} if the contract is broken. * - * @param type - * Constant Type - * @param name - * Name of Constant - * @param value - * Assigned Value + * @param type Constant Type + * @param name Name of Constant + * @param value Assigned Value * @return new Constant instance. */ Constant addConstant(Type type, String name, Object value); /** - * Adds new Enumeration definition for Generated Type Builder and returns - * Enum Builder for specifying all Enum parameters.
- * If there is already Enumeration stored with the same name, the old enum - * will be simply overwritten byt new enum definition.
- * Name of Enumeration cannot be null, if it is - * null the method SHOULD throw - * {@link IllegalArgumentException} + * Adds new Enumeration definition for Generated Type Builder and returns Enum Builder for specifying all Enum + * parameters.
+ * If there is already Enumeration stored with the same name, the old enum will be simply overwritten byt new enum + * definition.
+ * Name of Enumeration cannot be null, if it is null the method SHOULD throw + * {@link IllegalArgumentException}. * - * @param name - * Enumeration Name + * @param name Enumeration Name * @return new instance of Enumeration Builder. */ EnumBuilder addEnumeration(String name); @@ -121,27 +103,23 @@ public interface GeneratedTypeBuilderBase> List getMethodDefinitions(); /** - * Add new Method Signature definition for Generated Type Builder and - * returns Method Signature Builder for specifying all Method parameters.
- * Name of Method cannot be null, if it is null - * the method SHOULD throw {@link IllegalArgumentException}
+ * Add new Method Signature definition for Generated Type Builder and returns Method Signature Builder + * for specifying all Method parameters.
+ * Name of Method cannot be null, if it is null the method SHOULD throw + * {@link IllegalArgumentException}.
* By Default the MethodSignatureBuilder SHOULD be pre-set as - * {@link MethodSignatureBuilder#setAbstract(boolean)}, - * {TypeMemberBuilder#setFinal(boolean)} and + * {@link MethodSignatureBuilder#setAbstract(boolean)}, {TypeMemberBuilder#setFinal(boolean)} and * {TypeMemberBuilder#setAccessModifier(boolean)} * - * @param name - * Name of Method + * @param name Name of Method * @return new instance of Method Signature Builder. */ MethodSignatureBuilder addMethod(String name); /** - * Checks if GeneratedTypeBuilder contains method with name - * methodName + * Checks if GeneratedTypeBuilder contains method with name methodName. * - * @param methodName - * is method name + * @param methodName is method name */ boolean containsMethod(String methodName); @@ -155,42 +133,35 @@ public interface GeneratedTypeBuilderBase> Optional getYangSourceDefinition(); /** - * Add new Generated Property definition for Generated Transfer Object - * Builder and returns Generated Property Builder for specifying Property.
- * Name of Property cannot be null, if it is null - * the method SHOULD throw {@link IllegalArgumentException} + * Add new Generated Property definition for Generated Transfer Object Builder and returns Generated Property + * Builder for specifying Property.
+ * Name of Property cannot be null, if it is null the method SHOULD throw + * {@link IllegalArgumentException}. * - * @param name - * Name of Property + * @param name Name of Property * @return new instance of Generated Property Builder. */ GeneratedPropertyBuilder addProperty(String name); /** - * Check whether GeneratedTOBuilder contains property with name - * name + * Check whether GeneratedTOBuilder contains property with name name. * - * @param name - * of property which existance is checked + * @param name of property which existence is checked * @return true if property name exists in list of properties. */ boolean containsProperty(String name); /** - * Set a string that contains a human-readable textual description of type - * definition. + * Set a string that contains a human-readable textual description of type definition. * - * @param description - * a string that contains a human-readable textual description of - * type definition. + * @param description a string that contains a human-readable textual description of type definition. */ void setDescription(String description); /** * Set the name of the module, in which generated type was specified. * - * @param moduleName - * the name of the module + * @param moduleName the name of the module */ void setModuleName(String moduleName); @@ -202,13 +173,11 @@ public interface GeneratedTypeBuilderBase> void setSchemaPath(SchemaPath schemaPath); /** - * Set a string that is used to specify a textual cross-reference to an - * external document, either another module that defines related management - * information, or a document that provides additional information relevant - * to this definition. + * Set a string that is used to specify a textual cross-reference to an external document, either another module + * that defines related management information, or a document that provides additional information relevant to this + * definition. * - * @param reference - * a textual cross-reference to an external document. + * @param reference a textual cross-reference to an external document. */ void setReference(String reference); diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java index e683ebd054..316de89c18 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/MethodSignatureBuilder.java @@ -22,19 +22,16 @@ import org.opendaylight.mdsal.binding.model.api.Type; * {@link #setComment(String)} can be used as optional because not all methods * MUST contain annotation or comment definitions. * - * * @see MethodSignature */ public interface MethodSignatureBuilder extends TypeMemberBuilder { - /** * Sets the flag for declaration of method as abstract or non abstract. If * the flag isAbstract == true The instantiated Method * Signature MUST have return value for {@link MethodSignature#isAbstract()} * also equals to true. * - * @param isAbstract - * is abstract flag + * @param isAbstract is abstract flag */ MethodSignatureBuilder setAbstract(boolean isAbstract); @@ -46,12 +43,10 @@ public interface MethodSignatureBuilder extends TypeMemberBuildernull the * method SHOULD throw an {@link IllegalArgumentException} * - * @param type - * Parameter Type - * @param name - * Parameter Name + * @param type Parameter Type + * @param name Parameter Name */ - MethodSignatureBuilder addParameter(final Type type, final String name); + MethodSignatureBuilder addParameter(Type type, String name); /** * Returns new immutable instance of Method Signature.
@@ -61,9 +56,8 @@ public interface MethodSignatureBuilder extends TypeMemberBuildernull reference the method * SHOULD thrown {@link IllegalArgumentException}. * - * @param definingType - * Defining Type of Method Signature + * @param definingType Defining Type of Method Signature * @return new immutable instance of Method Signature. */ - MethodSignature toInstance(final Type definingType); + MethodSignature toInstance(Type definingType); } diff --git a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java index e88b33b706..ddb84d6eca 100644 --- a/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java +++ b/binding/mdsal-binding-generator-api/src/main/java/org/opendaylight/mdsal/binding/model/api/type/builder/TypeMemberBuilder.java @@ -22,20 +22,18 @@ public interface TypeMemberBuilder> extends Annot * Adds return Type into Builder definition for Generated Property. The return Type MUST NOT be null, * otherwise the method SHOULD throw {@link IllegalArgumentException} * - * @param returnType - * Return Type of property. + * @param returnType Return Type of property. */ - T setReturnType(final Type returnType); + T setReturnType(Type returnType); AccessModifier getAccessModifier(); /** * Sets the access modifier of property. * - * @param modifier - * Access Modifier value. + * @param modifier Access Modifier value. */ - T setAccessModifier(final AccessModifier modifier); + T setAccessModifier(AccessModifier modifier); /** * Adds String definition of comment into Method Signature definition. The comment String MUST NOT contain any @@ -43,7 +41,7 @@ public interface TypeMemberBuilder> extends Annot * * @param comment Comment String. */ - T setComment(final String comment); + T setComment(String comment); /** * Sets the flag final for method signature. If this is set the method will be prohibited from overriding. This @@ -52,7 +50,7 @@ public interface TypeMemberBuilder> extends Annot * * @param isFinal Is Final */ - T setFinal(final boolean isFinal); + T setFinal(boolean isFinal); - T setStatic(final boolean isStatic); + T setStatic(boolean isStatic); } -- 2.36.6