2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
9 @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.fieldName
10 @import org.opendaylight.mdsal.binding.javav2.java.api.generator.util.TextTemplateUtil.getterMethodName
11 @import org.opendaylight.mdsal.binding.javav2.model.api.GeneratedProperty
13 @(allProps: List[GeneratedProperty], keyProps: List[GeneratedProperty], importedNames: Map[String, String],
15 @if(keyProps != null) {
16 if (base.getKey() == null) {
17 this._key = new @{importedNames.get("keyTypeConstructor")}(
20 @for(field <- keyProps) {
21 this.@{fieldName(field)} = base.
22 @{getterMethodName(field)}();
25 this._key = base.getKey();
26 @for(field <- keyProps) {
27 this.@{fieldName(field)} = _key.@{getterMethodName(field)}();
31 @for(field <- allProps) {
32 this.@{fieldName(field)} = base.@{getterMethodName(field)}();