Binding generator v2 - Instantiable compilability fix
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / java / api / generator / classTemplateUnionConstr.scala.txt
1 @*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *@
8
9 @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.asArguments
10 @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.fieldName
11 @import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedProperty
12 @import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedType
13
14 @(genType: GeneratedType, parentProperties: List[GeneratedProperty], allProperty: GeneratedProperty, other: List[GeneratedProperty],
15 importedName: String, genRestrictions: String)
16 public @{genType.getName}(@{importedName} @{allProperty.getName}) {
17     @if(!parentProperties.isEmpty) {
18         super(@{asArguments(parentProperties)});
19     }
20
21     @{genRestrictions}
22
23     this.@{fieldName(allProperty)} = @{allProperty.getName};
24     @for(item <- other) {
25         this.@{fieldName(item)} = null;
26     }
27 }