public final class RuntimeGeneratedTOBuilder extends AbstractBaseType
Constructor and Description |
---|
RuntimeGeneratedTOBuilder(JavaTypeName identifier) |
Modifier and Type | Method and Description |
---|---|
AnnotationTypeBuilder |
addAnnotation(JavaTypeName identifier)
The method creates new
AnnotationTypeBuilder containing specified package name an annotation name. |
T |
addComment(TypeComment newComment)
Adds String definition of comment into Method Signature definition.
The comment String MUST NOT contain any comment specific chars (i.e. |
Constant |
addConstant(Type type,
String name,
Object value)
Adds Constant definition and returns
new Constant instance.By definition Constant MUST be defined by return Type, Name and assigned value. |
T |
addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder)
Adds new Enclosing Transfer Object
genTOBuilder into definition of Generated Type. |
GeneratedTOBuilder |
addEnclosingTransferObject(String name)
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 IllegalArgumentException . |
EnumBuilder |
addEnumeration(String name)
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
IllegalArgumentException . |
GeneratedTOBuilder |
addEqualsIdentity(GeneratedPropertyBuilder property)
Add Property that will be part of
equals definition. |
GeneratedTOBuilder |
addHashIdentity(GeneratedPropertyBuilder property)
Add Property that will be part of
hashCode definition. |
T |
addImplementsType(Type genType)
Add Type to implements.
|
MethodSignatureBuilder |
addMethod(String name)
Add new Method Signature definition for Generated Type Builder and
returns Method Signature Builder for specifying all Method parameters.
|
GeneratedPropertyBuilder |
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 be null , if it is null the method SHOULD throw
IllegalArgumentException . |
GeneratedTOBuilder |
addToStringProperty(GeneratedPropertyBuilder property)
Add Property that will be part of
toString definition. |
GeneratedTransferObject |
build()
Returns instance of
GeneratedTransferObject which data are build from the data of this builder. |
boolean |
containsConstant(String name) |
boolean |
containsMethod(String name)
Checks if GeneratedTypeBuilder contains method with name
methodName . |
boolean |
containsProperty(String name)
Check whether GeneratedTOBuilder contains property with name
name . |
boolean |
equals(Object obj) |
protected List<AnnotationTypeBuilder> |
getAnnotations() |
protected TypeComment |
getComment() |
protected List<Constant> |
getConstants() |
protected List<GeneratedTOBuilder> |
getEnclosedTransferObjects() |
protected List<GeneratedTypeBuilder> |
getEnclosedTypes() |
protected List<EnumBuilder> |
getEnumerations() |
List<Type> |
getImplementsTypes() |
List<MethodSignatureBuilder> |
getMethodDefinitions() |
Type |
getParent() |
List<GeneratedPropertyBuilder> |
getProperties() |
Optional<YangSourceDefinition> |
getYangSourceDefinition()
Returns the YANG definition of this type, if available.
|
int |
hashCode() |
boolean |
isAbstract() |
boolean |
isUnion() |
T |
setAbstract(boolean newIsAbstract)
Sets the
abstract flag to define Generated Type as abstract type. |
void |
setBaseType(org.opendaylight.yangtools.yang.model.api.TypeDefinition<?> typeDef)
Sets the base type for Java representation of YANG typedef.
|
void |
setDescription(String description)
Set a string that contains a human-readable textual description of type definition.
|
GeneratedTOBuilder |
setExtendsType(GeneratedTransferObject genTransObj)
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 IllegalArgumentException |
void |
setIsUnion(boolean newIsUnion)
Sets the union flag.
|
void |
setIsUnionBuilder(boolean newIsUnionTypeBuilder) |
void |
setModuleName(String moduleName)
Set the name of the module, in which generated type was specified.
|
void |
setReference(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.
|
void |
setRestrictions(Restrictions restrictions) |
void |
setSchemaPath(org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath)
Schema path in schema tree from actual concrete type to the root.
|
void |
setSUID(GeneratedPropertyBuilder suid) |
void |
setTypedef(boolean newIsTypedef) |
void |
setYangSourceDefinition(YangSourceDefinition definition)
Set the YANG source definition.
|
protected GeneratedTOBuilder |
thisInstance() |
String |
toString() |
getIdentifier
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addComment, addConstant, addEnclosingTransferObject, addEnclosingTransferObject, addEnumeration, addImplementsType, addProperty, containsMethod, containsProperty, getImplementsTypes, getMethodDefinitions, getProperties, getYangSourceDefinition, isAbstract, setAbstract, setYangSourceDefinition
getFullyQualifiedName, getName, getPackageName
addAnnotation, addAnnotation
public RuntimeGeneratedTOBuilder(JavaTypeName identifier)
public void setRestrictions(Restrictions restrictions)
public void setSUID(GeneratedPropertyBuilder suid)
public void setDescription(String description)
GeneratedTypeBuilderBase
description
- a string that contains a human-readable textual description of type definition.public void setModuleName(String moduleName)
GeneratedTypeBuilderBase
moduleName
- the name of the modulepublic void setSchemaPath(org.opendaylight.yangtools.yang.model.api.SchemaPath schemaPath)
GeneratedTypeBuilderBase
schemaPath
- schema path in schema treepublic void setReference(String reference)
GeneratedTypeBuilderBase
reference
- a textual cross-reference to an external document.public GeneratedTransferObject build()
GeneratedTOBuilder
GeneratedTransferObject
which data are build from the data of this builder.public final GeneratedTOBuilder setExtendsType(GeneratedTransferObject genTransObj)
GeneratedTOBuilder
null
the method SHOULD throw IllegalArgumentException
setExtendsType
in interface GeneratedTOBuilder
genTransObj
- Generated Transfer Objectpublic final MethodSignatureBuilder addMethod(String name)
null
, if it is null
the method SHOULD throw IllegalArgumentException
MethodSignatureBuilder.setAbstract(boolean)
,
{TypeMemberBuilder#setFinal(boolean)} and
{TypeMemberBuilder#setAccessModifier(boolean)}addMethod
in interface GeneratedTypeBuilderBase<GeneratedTOBuilder>
name
- Name of Methodnew
instance of Method Signature Builder.public final GeneratedTOBuilder addEqualsIdentity(GeneratedPropertyBuilder property)
GeneratedTOBuilder
equals
definition. null
the method SHOULD
throw IllegalArgumentException
addEqualsIdentity
in interface GeneratedTOBuilder
property
- Generated Property Builderpublic final GeneratedTOBuilder addHashIdentity(GeneratedPropertyBuilder property)
GeneratedTOBuilder
hashCode
definition. null
the method SHOULD
throw IllegalArgumentException
addHashIdentity
in interface GeneratedTOBuilder
property
- Generated Property Builderpublic final GeneratedTOBuilder addToStringProperty(GeneratedPropertyBuilder property)
GeneratedTOBuilder
toString
definition. null
the method SHOULD
throw IllegalArgumentException
addToStringProperty
in interface GeneratedTOBuilder
property
- Generated Property Builderprotected final GeneratedTOBuilder thisInstance()
public final String toString()
toString
in class AbstractBaseType
public final void setTypedef(boolean newIsTypedef)
setTypedef
in interface GeneratedTOBuilder
public final void setBaseType(org.opendaylight.yangtools.yang.model.api.TypeDefinition<?> typeDef)
GeneratedTOBuilder
setBaseType
in interface GeneratedTOBuilder
typeDef
- Type Definitionpublic final void setIsUnion(boolean newIsUnion)
GeneratedTOBuilder
setIsUnion
in interface GeneratedTOBuilder
newIsUnion
- true if the result is a union type.public final boolean isUnion()
isUnion
in interface GeneratedTOBuilder
public final void setIsUnionBuilder(boolean newIsUnionTypeBuilder)
setIsUnionBuilder
in interface GeneratedTOBuilder
protected TypeComment getComment()
protected List<AnnotationTypeBuilder> getAnnotations()
public boolean isAbstract()
isAbstract
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
public List<Type> getImplementsTypes()
getImplementsTypes
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
protected List<EnumBuilder> getEnumerations()
public List<MethodSignatureBuilder> getMethodDefinitions()
getMethodDefinitions
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
protected List<GeneratedTypeBuilder> getEnclosedTypes()
protected List<GeneratedTOBuilder> getEnclosedTransferObjects()
public GeneratedTOBuilder addEnclosingTransferObject(String name)
GeneratedTypeBuilderBase
new
Instance
of Generated TO Builder.null
the method SHOULD throw IllegalArgumentException
.addEnclosingTransferObject
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
name
- Name of Enclosing Typenew
Instance of Generated Type Builder.public T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder)
GeneratedTypeBuilderBase
genTOBuilder
into definition of Generated Type.
genTOBuilder
of enclosing type is null
the method SHOULD throw
IllegalArgumentException
.addEnclosingTransferObject
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
genTOBuilder
- Name of Enclosing Typepublic T addComment(TypeComment newComment)
GeneratedTypeBuilderBase
addComment
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
newComment
- Comment String.public AnnotationTypeBuilder addAnnotation(JavaTypeName identifier)
AnnotableTypeBuilder
AnnotationTypeBuilder
containing specified package name an annotation name.addAnnotation
in interface AnnotableTypeBuilder
identifier
- JavaTypeName of the annotationpublic T setAbstract(boolean newIsAbstract)
GeneratedTypeBuilderBase
abstract
flag to define Generated Type as abstract type.setAbstract
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
newIsAbstract
- abstract flagpublic T addImplementsType(Type genType)
GeneratedTypeBuilderBase
addImplementsType
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
genType
- Type to implementtrue
if the addition of type is successful.public Constant addConstant(Type type, String name, Object value)
GeneratedTypeBuilderBase
new
Constant instance.null
and the method SHOULD throw
IllegalArgumentException
if the contract is broken.addConstant
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
type
- Constant Typename
- Name of Constantvalue
- Assigned Valuenew
Constant instance.public boolean containsConstant(String name)
public EnumBuilder addEnumeration(String name)
GeneratedTypeBuilderBase
null
, if it is null
the method SHOULD throw
IllegalArgumentException
.addEnumeration
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
name
- Enumeration Namenew
instance of Enumeration Builder.public boolean containsMethod(String name)
GeneratedTypeBuilderBase
methodName
.containsMethod
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
name
- is method namepublic GeneratedPropertyBuilder addProperty(String name)
GeneratedTypeBuilderBase
null
, if it is null
the method SHOULD throw
IllegalArgumentException
.addProperty
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
name
- Name of Propertynew
instance of Generated Property Builder.public boolean containsProperty(String name)
GeneratedTypeBuilderBase
name
.containsProperty
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
name
- of property which existence is checkedname
exists in list of properties.public Type getParent()
public List<GeneratedPropertyBuilder> getProperties()
getProperties
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
public Optional<YangSourceDefinition> getYangSourceDefinition()
GeneratedTypeBuilderBase
getYangSourceDefinition
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
public void setYangSourceDefinition(YangSourceDefinition definition)
GeneratedTypeBuilderBase
setYangSourceDefinition
in interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>>
definition
- YANG source definition, must not be nullpublic int hashCode()
hashCode
in class AbstractBaseType
public boolean equals(Object obj)
equals
in class AbstractBaseType
Copyright © 2019 OpenDaylight. All rights reserved.