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 private long packageSize = 0; 35 setResult(boolean result)36 void setResult(boolean result) { 37 this.result = result; 38 } 39 setMessage(String message)40 void setMessage(String message) { 41 this.message = message; 42 } 43 setPackInfos(List<PackInfo> packInfos)44 void setPackInfos(List<PackInfo> packInfos) { 45 this.packInfos = packInfos; 46 } 47 setProfileInfos(List<ProfileInfo> profileInfos)48 void setProfileInfos(List<ProfileInfo> profileInfos) { 49 this.profileInfos = profileInfos; 50 } 51 setPackInfoStr(String packInfoStr)52 void setPackInfoStr(String packInfoStr) { 53 this.packInfoStr = packInfoStr; 54 } 55 setProfileInfosStr(List<String> profileInfosStr)56 void setProfileInfosStr(List<String> profileInfosStr) { 57 this.profileInfosStr = profileInfosStr; 58 } 59 setLabel(String label)60 void setLabel(String label) { 61 this.label = label; 62 } 63 setIcon(String icon)64 void setIcon(String icon) { 65 this.icon = icon; 66 } 67 setPackageSize(long size)68 void setPackageSize(long size) { 69 this.packageSize = size; 70 } 71 72 /** 73 * Add the profileInfo to the profileInfo list. 74 * 75 * @param profileInfo the profileInfo to be added. 76 */ addProfileInfo(ProfileInfo profileInfo)77 void addProfileInfo(ProfileInfo profileInfo) { 78 if (profileInfos != null && profileInfo != null) { 79 this.profileInfos.add(profileInfo); 80 } 81 } 82 83 /** 84 * Add the profileInfoStr to the profileInfoStr list. 85 * 86 * @param profileInfoStr the profileInfoStr to be added. 87 */ addProfileInfoStr(String profileInfoStr)88 void addProfileInfoStr(String profileInfoStr) { 89 if (profileInfosStr != null && profileInfoStr != null && !profileInfoStr.isEmpty()) { 90 this.profileInfosStr.add(profileInfoStr); 91 } 92 } 93 getResult()94 public boolean getResult() { 95 return result; 96 } 97 getMessage()98 public String getMessage() { 99 return message; 100 } 101 getPackInfos()102 public List<PackInfo> getPackInfos() { 103 return packInfos; 104 } 105 getProfileInfos()106 public List<ProfileInfo> getProfileInfos() { 107 return profileInfos; 108 } 109 getPackInfoStr()110 public String getPackInfoStr() { 111 return packInfoStr; 112 } 113 getProfileInfosStr()114 public List<String> getProfileInfosStr() { 115 return profileInfosStr; 116 } 117 getLabel()118 public String getLabel() { 119 return label; 120 } 121 getIcon()122 public String getIcon() { 123 return icon; 124 } 125 getPackageSize()126 public long getPackageSize() { 127 return packageSize; 128 } 129 } 130