X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-java-api-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fjava%2Fapi%2Fgenerator%2FBuilderTemplate.xtend;h=549574bf12d6902c2b22523cb7f9d67b70d46f19;hb=02d20c1c5ae09f79dd6f20d650888679b127a243;hp=7dfd93a55154be5201a35d9904e9ed7052af6b74;hpb=f735dcbc86962f6b51abecadec0c00f595649984;p=mdsal.git diff --git a/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/BuilderTemplate.xtend b/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/BuilderTemplate.xtend index 7dfd93a551..549574bf12 100644 --- a/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/BuilderTemplate.xtend +++ b/binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/BuilderTemplate.xtend @@ -11,7 +11,7 @@ import static extension org.apache.commons.text.StringEscapeUtils.escapeJava import static org.opendaylight.mdsal.binding.model.ri.BindingTypes.DATA_OBJECT import static org.opendaylight.mdsal.binding.spec.naming.BindingMapping.AUGMENTABLE_AUGMENTATION_NAME import static org.opendaylight.mdsal.binding.spec.naming.BindingMapping.AUGMENTATION_FIELD -import static org.opendaylight.mdsal.binding.spec.naming.BindingMapping.DATA_CONTAINER_IMPLEMENTED_INTERFACE_NAME +import static org.opendaylight.mdsal.binding.spec.naming.BindingMapping.BINDING_CONTRACT_IMPLEMENTED_INTERFACE_NAME import com.google.common.collect.ImmutableList import com.google.common.collect.ImmutableSet @@ -202,7 +202,7 @@ class BuilderTemplate extends AbstractBuilderTemplate { * Set fields from given grouping argument. Valid argument is instance of one of following types: * * @@ -254,22 +254,11 @@ class BuilderTemplate extends AbstractBuilderTemplate { if (ownGetterType instanceof ParameterizedType) { val itemType = ownGetterType.actualTypeArguments.get(0) if (Types.isListType(ownGetterType)) { - val importedClass = importedClass(itemType) - if (importedClass !== null) { - return printPropertySetter(retrieveProperty, propertyName, "checkListFieldCastIdentity", importedClass) - } return printPropertySetter(retrieveProperty, propertyName, "checkListFieldCast", itemType.importedName) } if (Types.isSetType(ownGetterType)) { - val importedClass = importedClass(itemType) - if (importedClass !== null) { - return printPropertySetter(retrieveProperty, propertyName, "checkSetFieldCastIdentity", importedClass) - } return printPropertySetter(retrieveProperty, propertyName, "checkSetFieldCast", itemType.importedName) } - if (Types.CLASS.equals(ownGetterType)) { - return printPropertySetter(retrieveProperty, propertyName, "checkFieldCastIdentity", itemType.identifier.importedName) - } } return printPropertySetter(retrieveProperty, propertyName, "checkFieldCast", ownGetterType.importedName) } @@ -277,15 +266,6 @@ class BuilderTemplate extends AbstractBuilderTemplate { def private printPropertySetter(String retrieveProperty, String propertyName, String checkerName, String className) ''' this._«propertyName» = «CODEHELPERS.importedName».«checkerName»(«className».class, "«propertyName»", «retrieveProperty»)''' - private def importedClass(Type type) { - if (type instanceof ParameterizedType) { - if (Types.CLASS.equals(type.rawType)) { - return type.actualTypeArguments.get(0).identifier.importedName - } - } - return null - } - private def List getBaseIfcs(GeneratedType type) { val List baseIfcs = new ArrayList(); for (ifc : type.implements) { @@ -440,7 +420,7 @@ class BuilderTemplate extends AbstractBuilderTemplate { * @throws NullPointerException if {@code augmentation} is null */ public «type.name» addAugmentation(«augmentTypeRef» augmentation) { - «jlClassRef» augmentationType = augmentation.«DATA_CONTAINER_IMPLEMENTED_INTERFACE_NAME»(); + «jlClassRef» augmentationType = augmentation.«BINDING_CONTRACT_IMPLEMENTED_INTERFACE_NAME»(); if (!(this.«AUGMENTATION_FIELD» instanceof «hashMapRef»)) { this.«AUGMENTATION_FIELD» = new «hashMapRef»<>(); }