Interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
- All Superinterfaces:
AnnotableTypeBuilder,org.opendaylight.yangtools.concepts.Identifiable<JavaTypeName>,Type
- All Known Subinterfaces:
GeneratedTOBuilder,GeneratedTypeBuilder
public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
extends Type, AnnotableTypeBuilder
-
Method Summary
Modifier and TypeMethodDescriptionaddComment(TypeComment comment) Adds String definition of comment into Method Signature definition.
The comment String MUST NOT contain any comment specific chars (i.e.addConstant(Type type, String name, Object value) Adds Constant definition and returnsnewConstant instance.
By definition Constant MUST be defined by return Type, Name and assigned value.Adds new Enclosing Transfer ObjectgenTOBuilderinto definition of Generated Type.voidaddEnumeration(Enumeration enumeration) 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 benull, if it isnullthe method SHOULD throwIllegalArgumentException.addImplementsType(Type genType) Add Type to implements.Add new Method Signature definition for Generated Type Builder and returns Method Signature Builder for specifying all Method parameters.
Name of Method cannot benull, if it isnullthe method SHOULD throwIllegalArgumentException.
By Default the MethodSignatureBuilder SHOULD be pre-set asMethodSignatureBuilder.setAbstract(boolean), {TypeMemberBuilder#setFinal(boolean)} and {TypeMemberBuilder#setAccessModifier(boolean)}addProperty(String name) Add new Generated Property definition for Generated Transfer Object Builder and returns Generated Property Builder for specifying Property.
Name of Property cannot benull, if it isnullthe method SHOULD throwIllegalArgumentException.booleancontainsMethod(String methodName) Checks if GeneratedTypeBuilder contains method with namemethodName.booleancontainsProperty(String name) Check whether GeneratedTOBuilder contains property with namename.Returns the YANG definition of this type, if available.booleansetAbstract(boolean isAbstract) Sets theabstractflag to define Generated Type as abstract type.voidsetDescription(String description) Set a string that contains a human-readable textual description of type definition.voidsetModuleName(String moduleName) Set the name of the module, in which generated type was specified.voidsetReference(String reference) 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.voidsetYangSourceDefinition(@NonNull YangSourceDefinition definition) Set the YANG source definition.Methods inherited from interface org.opendaylight.mdsal.binding.model.api.type.builder.AnnotableTypeBuilder
addAnnotation, addAnnotationMethods inherited from interface org.opendaylight.yangtools.concepts.Identifiable
getIdentifierMethods inherited from interface org.opendaylight.mdsal.binding.model.api.Type
getFullyQualifiedName, getName, getPackageName
-
Method Details
-
addEnclosingTransferObject
Adds new Enclosing Transfer ObjectgenTOBuilderinto 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 parametergenTOBuilderof enclosing type isnullthe method SHOULD throwIllegalArgumentException.- Parameters:
genTO- Name of Enclosing Type
-
addComment
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.- Parameters:
comment- Comment String.
-
isAbstract
boolean isAbstract() -
setAbstract
Sets theabstractflag to define Generated Type as abstract type.- Parameters:
isAbstract- abstract flag
-
getImplementsTypes
-
addImplementsType
Add Type to implements.- Parameters:
genType- Type to implement- Returns:
trueif the addition of type is successful.
-
addConstant
Adds Constant definition and returnsnewConstant 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 benulland the method SHOULD throwIllegalArgumentExceptionif the contract is broken.- Parameters:
type- Constant Typename- Name of Constantvalue- Assigned Value- Returns:
newConstant instance.
-
addEnumeration
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 benull, if it isnullthe method SHOULD throwIllegalArgumentException.- Parameters:
enumeration- Enumeration to add
-
getMethodDefinitions
List<MethodSignatureBuilder> getMethodDefinitions() -
addMethod
Add new Method Signature definition for Generated Type Builder and returns Method Signature Builder for specifying all Method parameters.
Name of Method cannot benull, if it isnullthe method SHOULD throwIllegalArgumentException.
By Default the MethodSignatureBuilder SHOULD be pre-set asMethodSignatureBuilder.setAbstract(boolean), {TypeMemberBuilder#setFinal(boolean)} and {TypeMemberBuilder#setAccessModifier(boolean)}- Parameters:
name- Name of Method- Returns:
newinstance of Method Signature Builder.
-
containsMethod
Checks if GeneratedTypeBuilder contains method with namemethodName.- Parameters:
methodName- is method name
-
getProperties
List<GeneratedPropertyBuilder> getProperties() -
getYangSourceDefinition
Optional<YangSourceDefinition> getYangSourceDefinition()Returns the YANG definition of this type, if available.- Returns:
- YANG source definition, or empty when unavailable.
-
addProperty
Add new Generated Property definition for Generated Transfer Object Builder and returns Generated Property Builder for specifying Property.
Name of Property cannot benull, if it isnullthe method SHOULD throwIllegalArgumentException.- Parameters:
name- Name of Property- Returns:
newinstance of Generated Property Builder.
-
containsProperty
Check whether GeneratedTOBuilder contains property with namename.- Parameters:
name- of property which existence is checked- Returns:
- true if property
nameexists in list of properties.
-
setDescription
Set a string that contains a human-readable textual description of type definition.- Parameters:
description- a string that contains a human-readable textual description of type definition.
-
setModuleName
Set the name of the module, in which generated type was specified.- Parameters:
moduleName- the name of the module
-
setReference
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.- Parameters:
reference- a textual cross-reference to an external document.
-
setYangSourceDefinition
Set the YANG source definition.- Parameters:
definition- YANG source definition, must not be null
-