1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 package software.amazon.awssdk.codegen.model.intermediate; 17 18 public class MapModel { 19 20 private String implType; 21 22 private String interfaceType; 23 24 private String keyLocationName; 25 26 private MemberModel keyModel; 27 28 private String valueLocationName; 29 30 private MemberModel valueModel; 31 MapModel()32 public MapModel() { 33 } 34 MapModel(String implType, String interfaceType, String keyLocationName, MemberModel keyModel, String valueLocationName, MemberModel valueModel)35 public MapModel(String implType, 36 String interfaceType, 37 String keyLocationName, 38 MemberModel keyModel, 39 String valueLocationName, 40 MemberModel valueModel) { 41 42 this.implType = implType; 43 this.interfaceType = interfaceType; 44 this.keyLocationName = keyLocationName; 45 this.keyModel = keyModel; 46 this.valueLocationName = valueLocationName; 47 this.valueModel = valueModel; 48 } 49 getImplType()50 public String getImplType() { 51 return implType; 52 } 53 setImplType(String implType)54 public void setImplType(String implType) { 55 this.implType = implType; 56 } 57 getInterfaceType()58 public String getInterfaceType() { 59 return interfaceType; 60 } 61 setInterfaceType(String interfaceType)62 public void setInterfaceType(String interfaceType) { 63 this.interfaceType = interfaceType; 64 } 65 getKeyLocationName()66 public String getKeyLocationName() { 67 return keyLocationName; 68 } 69 setKeyLocationName(String keyLocationName)70 public void setKeyLocationName(String keyLocationName) { 71 this.keyLocationName = keyLocationName; 72 } 73 getKeyModel()74 public MemberModel getKeyModel() { 75 return keyModel; 76 } 77 setKeyModel(MemberModel keyModel)78 public void setKeyModel(MemberModel keyModel) { 79 this.keyModel = keyModel; 80 } 81 getValueLocationName()82 public String getValueLocationName() { 83 return valueLocationName; 84 } 85 setValueLocationName(String valueLocationName)86 public void setValueLocationName(String valueLocationName) { 87 this.valueLocationName = valueLocationName; 88 } 89 getValueModel()90 public MemberModel getValueModel() { 91 return valueModel; 92 } 93 setValueModel(MemberModel valueModel)94 public void setValueModel(MemberModel valueModel) { 95 this.valueModel = valueModel; 96 } 97 getTemplateType()98 public String getTemplateType() { 99 return interfaceType + 100 "<" + keyModel.getVariable().getVariableType() + "," + valueModel.getVariable().getVariableType() + ">"; 101 } 102 getEntryType()103 public String getEntryType() { 104 return String.format("Map.Entry<%s, %s>", 105 keyModel.getVariable().getVariableType(), valueModel.getVariable().getVariableType()); 106 } 107 } 108