1 /* 2 * Copyright (C) 2023 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.Nullable; 20 21 import com.android.ondevicepersonalization.internal.util.DataClass; 22 23 /** 24 * The result returned by {@link IsolatedWorker#onEvent(EventInput, android.os.OutcomeReceiver)}. 25 */ 26 @DataClass(genBuilder = true, genEqualsHashCode = true) 27 public final class EventOutput { 28 /** 29 * An {@link EventLogRecord} to be written to the EVENTS table, if not null. Each 30 * {@link EventLogRecord} is associated with a row in an existing {@link RequestLogRecord} that 31 * has been written to the REQUESTS table. 32 */ 33 @DataClass.MaySetToNull 34 @Nullable EventLogRecord mEventLogRecord = null; 35 36 37 38 // Code below generated by codegen v1.0.23. 39 // 40 // DO NOT MODIFY! 41 // CHECKSTYLE:OFF Generated code 42 // 43 // To regenerate run: 44 // $ codegen $ANDROID_BUILD_TOP/packages/modules/OnDevicePersonalization/framework/java/android/adservices/ondevicepersonalization/EventOutput.java 45 // 46 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 47 // Settings > Editor > Code Style > Formatter Control 48 //@formatter:off 49 50 51 @DataClass.Generated.Member EventOutput( @ullable EventLogRecord eventLogRecord)52 /* package-private */ EventOutput( 53 @Nullable EventLogRecord eventLogRecord) { 54 this.mEventLogRecord = eventLogRecord; 55 56 // onConstructed(); // You can define this method to get a callback 57 } 58 59 /** 60 * An {@link EventLogRecord} to be written to the EVENTS table, if not null. Each 61 * {@link EventLogRecord} is associated with a row in an existing {@link RequestLogRecord} that 62 * has been written to the REQUESTS table. 63 */ 64 @DataClass.Generated.Member getEventLogRecord()65 public @Nullable EventLogRecord getEventLogRecord() { 66 return mEventLogRecord; 67 } 68 69 @Override 70 @DataClass.Generated.Member equals(@ullable Object o)71 public boolean equals(@Nullable Object o) { 72 // You can override field equality logic by defining either of the methods like: 73 // boolean fieldNameEquals(EventOutput other) { ... } 74 // boolean fieldNameEquals(FieldType otherValue) { ... } 75 76 if (this == o) return true; 77 if (o == null || getClass() != o.getClass()) return false; 78 @SuppressWarnings("unchecked") 79 EventOutput that = (EventOutput) o; 80 //noinspection PointlessBooleanExpression 81 return true 82 && java.util.Objects.equals(mEventLogRecord, that.mEventLogRecord); 83 } 84 85 @Override 86 @DataClass.Generated.Member hashCode()87 public int hashCode() { 88 // You can override field hashCode logic by defining methods like: 89 // int fieldNameHashCode() { ... } 90 91 int _hash = 1; 92 _hash = 31 * _hash + java.util.Objects.hashCode(mEventLogRecord); 93 return _hash; 94 } 95 96 /** 97 * A builder for {@link EventOutput} 98 */ 99 @SuppressWarnings("WeakerAccess") 100 @DataClass.Generated.Member 101 public static final class Builder { 102 103 private @Nullable EventLogRecord mEventLogRecord; 104 105 private long mBuilderFieldsSet = 0L; 106 Builder()107 public Builder() { 108 } 109 110 /** 111 * An {@link EventLogRecord} to be written to the EVENTS table, if not null. Each 112 * {@link EventLogRecord} is associated with a row in an existing {@link RequestLogRecord} that 113 * has been written to the REQUESTS table. 114 */ 115 @DataClass.Generated.Member setEventLogRecord(@ullable EventLogRecord value)116 public @android.annotation.NonNull Builder setEventLogRecord(@Nullable EventLogRecord value) { 117 checkNotUsed(); 118 mBuilderFieldsSet |= 0x1; 119 mEventLogRecord = value; 120 return this; 121 } 122 123 /** Builds the instance. This builder should not be touched after calling this! */ build()124 public @android.annotation.NonNull EventOutput build() { 125 checkNotUsed(); 126 mBuilderFieldsSet |= 0x2; // Mark builder used 127 128 if ((mBuilderFieldsSet & 0x1) == 0) { 129 mEventLogRecord = null; 130 } 131 EventOutput o = new EventOutput( 132 mEventLogRecord); 133 return o; 134 } 135 checkNotUsed()136 private void checkNotUsed() { 137 if ((mBuilderFieldsSet & 0x2) != 0) { 138 throw new IllegalStateException( 139 "This Builder should not be reused. Use a new Builder instance instead"); 140 } 141 } 142 } 143 144 @DataClass.Generated( 145 time = 1707253681044L, 146 codegenVersion = "1.0.23", 147 sourceFile = "packages/modules/OnDevicePersonalization/framework/java/android/adservices/ondevicepersonalization/EventOutput.java", 148 inputSignatures = " @com.android.ondevicepersonalization.internal.util.DataClass.MaySetToNull @android.annotation.Nullable android.adservices.ondevicepersonalization.EventLogRecord mEventLogRecord\nclass EventOutput extends java.lang.Object implements []\n@com.android.ondevicepersonalization.internal.util.DataClass(genBuilder=true, genEqualsHashCode=true)") 149 @Deprecated __metadata()150 private void __metadata() {} 151 152 153 //@formatter:on 154 // End of generated code 155 156 } 157