1 /* 2 * Copyright (c) 2021 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.devtools.views.distributed.bean; 17 18 /** 19 * DistributedParams 20 * 21 * @since 2021/08/10 16:20 22 */ 23 public class DistributedParams { 24 private String pkgNameA; 25 private String pkgNameB; 26 private Integer processIdA; 27 private Integer processIdB; 28 private String deviceNameA; 29 private String deviceNameB; 30 private String pathA; 31 private String pathB; 32 private Long offsetA; 33 private Long offsetB; 34 35 /** 36 * DistributedParams const 37 * 38 * @param builder builder 39 */ DistributedParams(Builder builder)40 public DistributedParams(Builder builder) { 41 this.pkgNameA = builder.pkgNameA; 42 this.pkgNameB = builder.pkgNameB; 43 this.processIdA = builder.processIdA; 44 this.processIdB = builder.processIdB; 45 this.deviceNameA = builder.deviceNameA; 46 this.deviceNameB = builder.deviceNameB; 47 this.pathA = builder.pathA; 48 this.pathB = builder.pathB; 49 this.offsetA = builder.offsetA; 50 this.offsetB = builder.offsetB; 51 } 52 53 /** 54 * getPkgNameA 55 * 56 * @return String pkgNameA 57 */ getPkgNameA()58 public String getPkgNameA() { 59 return pkgNameA; 60 } 61 62 /** 63 * getPkgNameB 64 * 65 * @return String pkgNameB 66 */ getPkgNameB()67 public String getPkgNameB() { 68 return pkgNameB; 69 } 70 71 /** 72 * getProcessIdA 73 * 74 * @return Integer processIdA 75 */ getProcessIdA()76 public Integer getProcessIdA() { 77 return processIdA; 78 } 79 80 /** 81 * getProcessIdB 82 * 83 * @return Integer processIdB 84 */ getProcessIdB()85 public Integer getProcessIdB() { 86 return processIdB; 87 } 88 89 /** 90 * getDeviceNameA 91 * 92 * @return String deviceNameA 93 */ getDeviceNameA()94 public String getDeviceNameA() { 95 return deviceNameA; 96 } 97 98 /** 99 * getDeviceNameB 100 * 101 * @return String deviceNameB 102 */ getDeviceNameB()103 public String getDeviceNameB() { 104 return deviceNameB; 105 } 106 107 /** 108 * getPathA 109 * 110 * @return String pathA 111 */ getPathA()112 public String getPathA() { 113 return pathA; 114 } 115 116 /** 117 * getPathB 118 * 119 * @return String pathB 120 */ getPathB()121 public String getPathB() { 122 return pathB; 123 } 124 125 /** 126 * getOffsetA 127 * 128 * @return Long offsetA 129 */ getOffsetA()130 public Long getOffsetA() { 131 return offsetA; 132 } 133 134 /** 135 * getOffsetB 136 * 137 * @return Long offsetB 138 */ getOffsetB()139 public Long getOffsetB() { 140 return offsetB; 141 } 142 143 /** 144 * class Builder builder 145 */ 146 public static class Builder { 147 private String pkgNameA; 148 private String pkgNameB; 149 private String deviceNameA; 150 private String deviceNameB; 151 private Integer processIdA; 152 private Integer processIdB; 153 private String pathA; 154 private String pathB; 155 private Long offsetA; 156 private Long offsetB; 157 158 /** 159 * setPkgNameA 160 * 161 * @param pkgNameA pkgNameA 162 * @return Builder Builder 163 */ setPkgNameA(String pkgNameA)164 public Builder setPkgNameA(String pkgNameA) { 165 this.pkgNameA = pkgNameA; 166 return this; 167 } 168 169 /** 170 * setPkgNameB 171 * 172 * @param pkgNameB pkgNameB 173 * @return Builder Builder 174 */ setPkgNameB(String pkgNameB)175 public Builder setPkgNameB(String pkgNameB) { 176 this.pkgNameB = pkgNameB; 177 return this; 178 } 179 180 /** 181 * setDeviceNameA 182 * 183 * @param deviceNameA deviceNameA 184 * @return Builder Builder 185 */ setDeviceNameA(String deviceNameA)186 public Builder setDeviceNameA(String deviceNameA) { 187 this.deviceNameA = deviceNameA; 188 return this; 189 } 190 191 /** 192 * setDeviceNameB 193 * 194 * @param deviceNameB deviceNameB 195 * @return Builder Builder 196 */ setDeviceNameB(String deviceNameB)197 public Builder setDeviceNameB(String deviceNameB) { 198 this.deviceNameB = deviceNameB; 199 return this; 200 } 201 202 /** 203 * setProcessIdA 204 * 205 * @param processIdA processIdA 206 * @return Builder Builder 207 */ setProcessIdA(Integer processIdA)208 public Builder setProcessIdA(Integer processIdA) { 209 this.processIdA = processIdA; 210 return this; 211 } 212 213 /** 214 * setProcessIdB 215 * 216 * @param processIdB processIdB 217 * @return Builder Builder 218 */ setProcessIdB(Integer processIdB)219 public Builder setProcessIdB(Integer processIdB) { 220 this.processIdB = processIdB; 221 return this; 222 } 223 224 /** 225 * setPathA 226 * 227 * @param pathA pathA 228 * @return Builder Builder 229 */ setPathA(String pathA)230 public Builder setPathA(String pathA) { 231 this.pathA = pathA; 232 return this; 233 } 234 235 /** 236 * setPathB 237 * 238 * @param pathB pathB 239 * @return Builder Builder 240 */ setPathB(String pathB)241 public Builder setPathB(String pathB) { 242 this.pathB = pathB; 243 return this; 244 } 245 246 /** 247 * setOffsetA 248 * 249 * @param offsetA offsetA 250 * @return Builder Builder 251 */ setOffsetA(Long offsetA)252 public Builder setOffsetA(Long offsetA) { 253 this.offsetA = offsetA; 254 return this; 255 } 256 257 /** 258 * setOffsetB 259 * 260 * @param offsetB offsetB 261 * @return Builder Builder 262 */ setOffsetB(Long offsetB)263 public Builder setOffsetB(Long offsetB) { 264 this.offsetB = offsetB; 265 return this; 266 } 267 268 /** 269 * build current DistributedParams 270 * 271 * @return DistributedParams params 272 */ build()273 public DistributedParams build() { 274 return new DistributedParams(this); 275 } 276 } 277 } 278