/* * Copyright (c) 2017 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.mdsal.binding.javav2.model.api.type.builder; import com.google.common.annotations.Beta; import java.util.List; import org.opendaylight.mdsal.binding.javav2.model.api.Constant; import org.opendaylight.mdsal.binding.javav2.model.api.Type; import org.opendaylight.yangtools.yang.common.QName; @Beta public interface GeneratedTypeBuilderBase> extends Type { /** * 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 * @return new Instance of Generated Type Builder. */ GeneratedTOBuilder addEnclosingTransferObject(String name); /** * 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 */ T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder); /** * Adds String definition of comment into Method Signature definition.
* The comment String MUST NOT contain anny comment specific chars (i.e. * "/**" or "//") just plain String text description. * * @param comment * Comment String. */ T addComment(String comment); /** * The method creates new AnnotationTypeBuilder containing specified package * name an annotation name.
* Neither the package name or annotation name can contain null * 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 * @return new instance of Annotation Type Builder. */ AnnotationTypeBuilder addAnnotation(String packageName, String name); boolean isAbstract(); /** * Sets the abstract flag to define Generated Type as * abstract type. * * @param isAbstract * abstract flag */ T setAbstract(boolean isAbstract); List getImplementsTypes(); /** * Add Type to implements. * * @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 * {@link IllegalArgumentException} if the contract is broken. * * @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} * * @param name * Enumeration Name * @return new instance of Enumeration Builder. */ EnumBuilder addEnumeration(String name); /** * Sets parent type for data schema node node builder * * @param type generated parent type * @return generated type */ Type setParentTypeForBuilder(Type type); 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}
* By Default the MethodSignatureBuilder SHOULD be pre-set as * {@link MethodSignatureBuilder#setAbstract(boolean)}, * {TypeMemberBuilder#setFinal(boolean)} and * {TypeMemberBuilder#setAccessModifier(boolean)} * * @param name * Name of Method * @return new instance of Method Signature Builder. */ MethodSignatureBuilder addMethod(String name); /** * Checks if GeneratedTypeBuilder contains method with name * methodName * * @param methodName * is method name */ boolean containsMethod(String methodName); List getProperties(); /** * 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 * @return new instance of Generated Property Builder. */ GeneratedPropertyBuilder addProperty(String name); /** * Check whether GeneratedTOBuilder contains property with name * name * * @param name * of property which existance 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. * * @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 */ void setModuleName(String moduleName); /** * Set the base package name of the module, used to generate package name for * builders by reusing the original package name. * * @param basePackageName * the base package name of the module */ void setBasePackageName(String basePackageName); /** * Set a list of QNames which represent schema path in schema tree from * actual concrete type to the root. * * @param schemaPath * a list of QNames which represent schema path in schema tree */ void setSchemaPath(List 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. * * @param reference * a textual cross-reference to an external document. */ void setReference(String reference); }