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; 17 18 /** 19 * DistroFilter info 20 * 21 */ 22 public class DistroFilter { 23 /** 24 * Indicates the DistroFilter info ApiVersion 25 */ 26 public ApiVersion apiVersion = null; 27 28 /** 29 * Indicates the DistroFilter info ScreenShape 30 */ 31 public ScreenShape screenShape = null; 32 33 /** 34 * Indicates the DistroFilter info ScreenDensity 35 */ 36 public ScreenDensity screenDensity = null; 37 38 /** 39 * Indicates the DistroFilter info ScreenWindow 40 */ 41 public ScreenWindow screenWindow = null; 42 43 /** 44 * Indicates the DistroFilter info CountryCode 45 */ 46 public CountryCode countryCode = null; 47 48 /** 49 * dump distroFilter message. 50 * 51 * @return distroFilter dump string 52 */ dump()53 public String dump() { 54 String dumpStr = ""; 55 if (apiVersion == null && screenShape == null && screenDensity == null 56 && screenWindow == null && countryCode == null) { 57 return dumpStr; 58 } 59 dumpStr = "distroFilter:"; 60 if (apiVersion != null) { 61 String apiVersionStr = "apiVersion: policy is " + apiVersion.policy + ", value is " + apiVersion.value; 62 dumpStr += " " + apiVersionStr; 63 } 64 if (screenShape != null) { 65 String screenShapeStr = "screenShape: policy is " + screenShape.policy + ", value is " + screenShape.value; 66 dumpStr += " " + screenShapeStr; 67 } 68 if (screenDensity != null) { 69 String screenDensityStr = "screenDensity: policy is " + screenDensity.policy + ", value is " 70 + screenDensity.value; 71 dumpStr += " " + screenDensityStr; 72 } 73 if (screenWindow != null) { 74 String screenWindowStr = "screenWindow: policy is " + screenWindow.policy + ", value is " 75 + screenWindow.value; 76 dumpStr += " " + screenWindowStr; 77 } 78 if (countryCode != null) { 79 String countryCodeStr = "countryCode: policy is " + countryCode.policy + ", value is " + countryCode.value; 80 dumpStr += " " + countryCodeStr; 81 } 82 return dumpStr; 83 } 84 }