1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16package ohos; 17 18import java.util.HashMap; 19import java.util.Map; 20 21/** 22 * ModuleJson AppJson info. 23 * 24 */ 25class ModuleAppInfo { 26 private final Integer DEFAULT_VERSION_CODE = -1; 27 private final String RELEASE = "Release"; 28 private final String UNSPECIFIED = "unspecified"; 29 30 /** 31 * Indicates the bundleName of app AppJson. 32 */ 33 public String bundleName = ""; 34 35 /** 36 * Indicates the debug of app AppJson. 37 */ 38 public boolean debug = false; 39 40 /** 41 * Indicates the icon of app AppJson. 42 */ 43 public String icon = ""; 44 45 /** 46 * Indicates the label of app AppJson. 47 */ 48 public String label = ""; 49 50 /** 51 * Indicates the description of app AppJson. 52 */ 53 public String description = ""; 54 55 /** 56 * Indicates the vendor of app AppJson. 57 */ 58 public String vendor = ""; 59 60 /** 61 * Indicates the versionCode of app AppJson. 62 */ 63 public int versionCode = DEFAULT_VERSION_CODE; 64 65 /** 66 * Indicates the versionName of app AppJson. 67 */ 68 public String versionName = ""; 69 70 /** 71 * Indicates the minCompatibleVersionCode of app AppJson. 72 */ 73 public int minCompatibleVersionCode = DEFAULT_VERSION_CODE; 74 75 /** 76 * Indicates the minAPIVersion of app AppJson. 77 */ 78 public int minAPIVersion = DEFAULT_VERSION_CODE; 79 80 /** 81 * Indicates the targetAPIVersion of app AppJson. 82 */ 83 public int targetAPIVersion = DEFAULT_VERSION_CODE; 84 85 /** 86 * Indicates the apiReleaseType of app AppJson. 87 */ 88 public String apiReleaseType = RELEASE; 89 90 /** 91 * Indicates the distributedNotificationEnabled of app AppJson. 92 */ 93 public boolean distributedNotificationEnabled = false; 94 95 /** 96 * Indicates the entityType of app AppJson. 97 */ 98 public String entityType = UNSPECIFIED; 99 100 /** 101 * Indicates the appName of app AppJson. 102 */ 103 public String appName = ""; 104 105 /** 106 * Indicates the appNameEn of app AppJson. 107 */ 108 public String appNameEN = ""; 109 110 /** 111 * Indicates the deviceType of app AppJson. 112 */ 113 public Map<String, ModuleDeviceType> deviceTypes = new HashMap<>(); 114 115 /** 116 * Indicates the type of bundle. 117 */ 118 private String bundleType = "app"; 119 120 /** 121 * Indicates the version of sdk. 122 */ 123 private String compileSdkVersion = ""; 124 125 /** 126 * Indicates the type of sdk. 127 */ 128 private String compileSdkType = ""; 129 130 /** 131 * Indicates the targetBundleName of app AppJson. 132 */ 133 private String targetBundleName = ""; 134 135 /** 136 * Indicates the targetPriority of app AppJson. 137 */ 138 private int targetPriority = 0; 139 140 /** 141 * Indicates the descriptions of app AppJson, for multilingual. 142 */ 143 private HashMap<String, String> descriptions = new HashMap<>(); 144 145 /** 146 * Indicates the labels of app AppJson, for multilingual. 147 */ 148 private HashMap<String, String> labels = new HashMap<>(); 149 150 public void setDescriptions(HashMap<String, String> descriptions) { 151 this.descriptions = descriptions; 152 } 153 154 public void setLabels(HashMap<String, String> labels) { 155 this.labels = labels; 156 } 157 158 /** 159 * Set bundle type 160 * 161 * @param type bundle type 162 */ 163 public void setBundleType(String type) { 164 bundleType = type; 165 } 166 167 public HashMap<String, String> getDescriptions() { 168 return descriptions; 169 } 170 171 public HashMap<String, String> getLabels() { 172 return labels; 173 } 174 175 /** 176 * Get bundle type. 177 * 178 * @return bundle type 179 */ 180 public String getBundleType() { 181 return bundleType; 182 } 183 184 public String getCompileSdkVersion() { 185 return compileSdkVersion; 186 } 187 188 public void setCompileSdkVersion(String compileSdkVersion) { 189 this.compileSdkVersion = compileSdkVersion; 190 } 191 192 public String getCompileSdkType() { 193 return compileSdkType; 194 } 195 196 public void setCompileSdkType(String compileSdkType) { 197 this.compileSdkType = compileSdkType; 198 } 199 200 public String getTargetBundleName() { 201 return targetBundleName; 202 } 203 204 public void setTargetBundleName(String targetBundleName) { 205 this.targetBundleName = targetBundleName; 206 } 207 208 public int getTargetPriority() { 209 return targetPriority; 210 } 211 212 public void setTargetPriority(int targetPriority) { 213 this.targetPriority = targetPriority; 214 } 215} 216