• 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.List;
19 import java.util.ArrayList;
20 
21 /**
22  * Uncompress result for parse hap and parse app.
23  * Create in 2022/11/21
24  */
25 public class UncompressResult {
26     private boolean result = true;
27     private String message = "Success";
28     private List<PackInfo> packInfos = new ArrayList<PackInfo>();
29     private List<ProfileInfo> profileInfos = new ArrayList<ProfileInfo>();
30     private String packInfoStr = "";
31     private List<String> profileInfosStr = new ArrayList<String>();
32     private String icon = "";
33     private String label = "";
34 
setResult(boolean result)35     void setResult(boolean result) {
36         this.result = result;
37     }
38 
setMessage(String message)39     void setMessage(String message) {
40         this.message = message;
41     }
42 
setPackInfos(List<PackInfo> packInfos)43     void setPackInfos(List<PackInfo> packInfos) {
44         this.packInfos = packInfos;
45     }
46 
setProfileInfos(List<ProfileInfo> profileInfos)47     void setProfileInfos(List<ProfileInfo> profileInfos) {
48         this.profileInfos = profileInfos;
49     }
50 
setPackInfoStr(String packInfoStr)51     void setPackInfoStr(String packInfoStr) {
52         this.packInfoStr = packInfoStr;
53     }
54 
setProfileInfosStr(List<String> profileInfosStr)55     void setProfileInfosStr(List<String> profileInfosStr) {
56         this.profileInfosStr = profileInfosStr;
57     }
58 
setLabel(String label)59     void setLabel(String label) {
60         this.label = label;
61     }
62 
setIcon(String icon)63     void setIcon(String icon) {
64         this.icon = icon;
65     }
66 
67     /**
68      * Add the profileInfo to the profileInfo list.
69      *
70      * @param profileInfo the profileInfo to be added.
71      */
addProfileInfo(ProfileInfo profileInfo)72     void addProfileInfo(ProfileInfo profileInfo) {
73         if (profileInfos != null && profileInfo != null) {
74             this.profileInfos.add(profileInfo);
75         }
76     }
77 
78     /**
79      * Add the profileInfoStr to the profileInfoStr list.
80      *
81      * @param profileInfoStr the profileInfoStr to be added.
82      */
addProfileInfoStr(String profileInfoStr)83     void addProfileInfoStr(String profileInfoStr) {
84         if (profileInfosStr != null && profileInfoStr != null && !profileInfoStr.isEmpty()) {
85             this.profileInfosStr.add(profileInfoStr);
86         }
87     }
88 
getResult()89     public boolean getResult() {
90         return result;
91     }
92 
getMessage()93     public String getMessage() {
94         return message;
95     }
96 
getPackInfos()97     public List<PackInfo> getPackInfos() {
98         return packInfos;
99     }
100 
getProfileInfos()101     public List<ProfileInfo> getProfileInfos() {
102         return profileInfos;
103     }
104 
getPackInfoStr()105     public String getPackInfoStr() {
106         return packInfoStr;
107     }
108 
getProfileInfosStr()109     public List<String> getProfileInfosStr() {
110         return profileInfosStr;
111     }
112 
getLabel()113     public String getLabel() {
114         return label;
115     }
116 
getIcon()117     public String getIcon() {
118         return icon;
119     }
120 }
121