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