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 16 package ohos; 17 18 import java.util.HashMap; 19 import java.util.Map; 20 21 /** 22 * ModuleJson AppJson info. 23 * 24 */ 25 class 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 descriptions of app AppJson, for multilingual. 132 */ 133 private HashMap<String, String> descriptions = new HashMap<>(); 134 135 /** 136 * Indicates the labels of app AppJson, for multilingual. 137 */ 138 private HashMap<String, String> labels = new HashMap<>(); 139 setDescriptions(HashMap<String, String> descriptions)140 public void setDescriptions(HashMap<String, String> descriptions) { 141 this.descriptions = descriptions; 142 } 143 setLabels(HashMap<String, String> labels)144 public void setLabels(HashMap<String, String> labels) { 145 this.labels = labels; 146 } 147 148 /** 149 * Set bundle type 150 * 151 * @param type bundle type 152 */ setBundleType(String type)153 public void setBundleType(String type) { 154 bundleType = type; 155 } 156 getDescriptions()157 public HashMap<String, String> getDescriptions() { 158 return descriptions; 159 } 160 getLabels()161 public HashMap<String, String> getLabels() { 162 return labels; 163 } 164 165 /** 166 * Get bundle type. 167 * 168 * @return bundle type 169 */ getBundleType()170 public String getBundleType() { 171 return bundleType; 172 } 173 getCompileSdkVersion()174 public String getCompileSdkVersion() { 175 return compileSdkVersion; 176 } 177 setCompileSdkVersion(String compileSdkVersion)178 public void setCompileSdkVersion(String compileSdkVersion) { 179 this.compileSdkVersion = compileSdkVersion; 180 } 181 getCompileSdkType()182 public String getCompileSdkType() { 183 return compileSdkType; 184 } 185 setCompileSdkType(String compileSdkType)186 public void setCompileSdkType(String compileSdkType) { 187 this.compileSdkType = compileSdkType; 188 } 189 } 190