1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.adservices.ondevicepersonalization; 18 19 import android.annotation.NonNull; 20 import android.os.Parcelable; 21 22 import com.android.ondevicepersonalization.internal.util.AnnotationValidations; 23 import com.android.ondevicepersonalization.internal.util.DataClass; 24 25 import java.util.Collections; 26 import java.util.List; 27 28 /** 29 * Parcelable version of {@link DownloadCompletedOutput}. 30 * @hide 31 */ 32 @DataClass(genAidl = false, genBuilder = false) 33 public final class DownloadCompletedOutputParcel implements Parcelable { 34 /** 35 * The keys to be retained in the REMOTE_DATA table. Any existing keys that are not 36 * present in this list are removed from the table. 37 */ 38 @NonNull private List<String> mRetainedKeys = Collections.emptyList(); 39 40 /** @hide */ DownloadCompletedOutputParcel(@onNull DownloadCompletedOutput value)41 public DownloadCompletedOutputParcel(@NonNull DownloadCompletedOutput value) { 42 this(value.getRetainedKeys()); 43 } 44 45 46 47 // Code below generated by codegen v1.0.23. 48 // 49 // DO NOT MODIFY! 50 // CHECKSTYLE:OFF Generated code 51 // 52 // To regenerate run: 53 // $ codegen $ANDROID_BUILD_TOP/packages/modules/OnDevicePersonalization/framework/java/android/adservices/ondevicepersonalization/DownloadCompletedOutputParcel.java 54 // 55 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 56 // Settings > Editor > Code Style > Formatter Control 57 //@formatter:off 58 59 60 /** 61 * Creates a new DownloadCompletedOutputParcel. 62 * 63 * @param retainedKeys 64 * The keys to be retained in the REMOTE_DATA table. Any existing keys that are not 65 * present in this list are removed from the table. 66 */ 67 @DataClass.Generated.Member DownloadCompletedOutputParcel( @onNull List<String> retainedKeys)68 public DownloadCompletedOutputParcel( 69 @NonNull List<String> retainedKeys) { 70 this.mRetainedKeys = retainedKeys; 71 AnnotationValidations.validate( 72 NonNull.class, null, mRetainedKeys); 73 74 // onConstructed(); // You can define this method to get a callback 75 } 76 77 /** 78 * The keys to be retained in the REMOTE_DATA table. Any existing keys that are not 79 * present in this list are removed from the table. 80 */ 81 @DataClass.Generated.Member getRetainedKeys()82 public @NonNull List<String> getRetainedKeys() { 83 return mRetainedKeys; 84 } 85 86 @Override 87 @DataClass.Generated.Member writeToParcel(@onNull android.os.Parcel dest, int flags)88 public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { 89 // You can override field parcelling by defining methods like: 90 // void parcelFieldName(Parcel dest, int flags) { ... } 91 92 dest.writeStringList(mRetainedKeys); 93 } 94 95 @Override 96 @DataClass.Generated.Member describeContents()97 public int describeContents() { return 0; } 98 99 /** @hide */ 100 @SuppressWarnings({"unchecked", "RedundantCast"}) 101 @DataClass.Generated.Member DownloadCompletedOutputParcel(@onNull android.os.Parcel in)102 /* package-private */ DownloadCompletedOutputParcel(@NonNull android.os.Parcel in) { 103 // You can override field unparcelling by defining methods like: 104 // static FieldType unparcelFieldName(Parcel in) { ... } 105 106 List<String> retainedKeys = new java.util.ArrayList<>(); 107 in.readStringList(retainedKeys); 108 109 this.mRetainedKeys = retainedKeys; 110 AnnotationValidations.validate( 111 NonNull.class, null, mRetainedKeys); 112 113 // onConstructed(); // You can define this method to get a callback 114 } 115 116 @DataClass.Generated.Member 117 public static final @NonNull Parcelable.Creator<DownloadCompletedOutputParcel> CREATOR 118 = new Parcelable.Creator<DownloadCompletedOutputParcel>() { 119 @Override 120 public DownloadCompletedOutputParcel[] newArray(int size) { 121 return new DownloadCompletedOutputParcel[size]; 122 } 123 124 @Override 125 public DownloadCompletedOutputParcel createFromParcel(@NonNull android.os.Parcel in) { 126 return new DownloadCompletedOutputParcel(in); 127 } 128 }; 129 130 @DataClass.Generated( 131 time = 1698783477713L, 132 codegenVersion = "1.0.23", 133 sourceFile = "packages/modules/OnDevicePersonalization/framework/java/android/adservices/ondevicepersonalization/DownloadCompletedOutputParcel.java", 134 inputSignatures = "private @android.annotation.NonNull java.util.List<java.lang.String> mRetainedKeys\nclass DownloadCompletedOutputParcel extends java.lang.Object implements [android.os.Parcelable]\n@com.android.ondevicepersonalization.internal.util.DataClass(genAidl=false, genBuilder=false)") 135 @Deprecated __metadata()136 private void __metadata() {} 137 138 139 //@formatter:on 140 // End of generated code 141 142 } 143