• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 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     /**
151      * Indicates the iconId of app AppJson.
152      */
153     private int iconId = 0;
154 
155     /**
156      * Indicates the labelId of app AppJson.
157      */
158     private int labelId = 0;
159 
setDescriptions(HashMap<String, String> descriptions)160     public void setDescriptions(HashMap<String, String> descriptions) {
161         this.descriptions = descriptions;
162     }
163 
setLabels(HashMap<String, String> labels)164     public void setLabels(HashMap<String, String> labels) {
165         this.labels = labels;
166     }
167 
168     /**
169      * Set bundle type
170      *
171      * @param type bundle type
172      */
setBundleType(String type)173     public void setBundleType(String type) {
174         bundleType = type;
175     }
176 
getDescriptions()177     public HashMap<String, String> getDescriptions() {
178         return descriptions;
179     }
180 
getLabels()181     public HashMap<String, String> getLabels() {
182         return labels;
183     }
184 
185     /**
186      * Get bundle type.
187      *
188      * @return bundle type
189      */
getBundleType()190     public String getBundleType() {
191         return bundleType;
192     }
193 
getCompileSdkVersion()194     public String getCompileSdkVersion() {
195         return compileSdkVersion;
196     }
197 
setCompileSdkVersion(String compileSdkVersion)198     public void setCompileSdkVersion(String compileSdkVersion) {
199         this.compileSdkVersion = compileSdkVersion;
200     }
201 
getCompileSdkType()202     public String getCompileSdkType() {
203         return compileSdkType;
204     }
205 
setCompileSdkType(String compileSdkType)206     public void setCompileSdkType(String compileSdkType) {
207         this.compileSdkType = compileSdkType;
208     }
209 
getTargetBundleName()210     public String getTargetBundleName() {
211         return targetBundleName;
212     }
213 
setTargetBundleName(String targetBundleName)214     public void setTargetBundleName(String targetBundleName) {
215         this.targetBundleName = targetBundleName;
216     }
217 
getTargetPriority()218     public int getTargetPriority() {
219         return targetPriority;
220     }
221 
setTargetPriority(int targetPriority)222     public void setTargetPriority(int targetPriority) {
223         this.targetPriority = targetPriority;
224     }
225 
getIconId()226     public int getIconId() {
227         return iconId;
228     }
229 
setIconId(int iconId)230     public void setIconId(int iconId) {
231         this.iconId = iconId;
232     }
233 
getLabelId()234     public int getLabelId() {
235         return labelId;
236     }
237 
setLabelId(int labelId)238     public void setLabelId(int labelId) {
239         this.labelId = labelId;
240     }
241 }
242