1 /*
2  * Copyright (C) 2024 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 com.android.federatedcompute.services.statsd;
18 
19 import com.android.ondevicepersonalization.internal.util.DataClass;
20 
21 /**
22  * Class holds ExampleIteratorNextLatencyReported defined at
23  * frameworks/proto_logging/stats/atoms/federatedcompute/federatedcompute_extension_atoms.proto
24  */
25 @DataClass(genBuilder = true, genEqualsHashCode = true)
26 public class ExampleIteratorLatency {
27     private long mClientVersion;
28     private long mTaskId;
29     private long mGetNextLatencyNanos;
30 
31     // Code below generated by codegen v1.0.23.
32     //
33     // DO NOT MODIFY!
34     // CHECKSTYLE:OFF Generated code
35     //
36     // To regenerate run:
37     // $ codegen
38     // $ANDROID_BUILD_TOP/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/statsd/ExampleIteratorLatency.java
39     //
40     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
41     //   Settings > Editor > Code Style > Formatter Control
42     // @formatter:off
43 
44     @DataClass.Generated.Member
ExampleIteratorLatency( long clientVersion, long taskId, long getNextLatencyNanos)45     /* package-private */ ExampleIteratorLatency(
46             long clientVersion, long taskId, long getNextLatencyNanos) {
47         this.mClientVersion = clientVersion;
48         this.mTaskId = taskId;
49         this.mGetNextLatencyNanos = getNextLatencyNanos;
50 
51         // onConstructed(); // You can define this method to get a callback
52     }
53 
54     @DataClass.Generated.Member
getClientVersion()55     public long getClientVersion() {
56         return mClientVersion;
57     }
58 
59     @DataClass.Generated.Member
getTaskId()60     public long getTaskId() {
61         return mTaskId;
62     }
63 
64     @DataClass.Generated.Member
getGetNextLatencyNanos()65     public long getGetNextLatencyNanos() {
66         return mGetNextLatencyNanos;
67     }
68 
69     @Override
70     @DataClass.Generated.Member
equals(@ndroid.annotation.Nullable Object o)71     public boolean equals(@android.annotation.Nullable Object o) {
72         // You can override field equality logic by defining either of the methods like:
73         // boolean fieldNameEquals(ExampleIteratorLatency 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         ExampleIteratorLatency that = (ExampleIteratorLatency) o;
80         //noinspection PointlessBooleanExpression
81         return true
82                 && mClientVersion == that.mClientVersion
83                 && mTaskId == that.mTaskId
84                 && mGetNextLatencyNanos == that.mGetNextLatencyNanos;
85     }
86 
87     @Override
88     @DataClass.Generated.Member
hashCode()89     public int hashCode() {
90         // You can override field hashCode logic by defining methods like:
91         // int fieldNameHashCode() { ... }
92 
93         int _hash = 1;
94         _hash = 31 * _hash + Long.hashCode(mClientVersion);
95         _hash = 31 * _hash + Long.hashCode(mTaskId);
96         _hash = 31 * _hash + Long.hashCode(mGetNextLatencyNanos);
97         return _hash;
98     }
99 
100     /** A builder for {@link ExampleIteratorLatency} */
101     @SuppressWarnings("WeakerAccess")
102     @DataClass.Generated.Member
103     public static class Builder {
104 
105         private long mClientVersion;
106         private long mTaskId;
107         private long mGetNextLatencyNanos;
108 
109         private long mBuilderFieldsSet = 0L;
110 
Builder()111         public Builder() {}
112 
113         @DataClass.Generated.Member
setClientVersion(long value)114         public @android.annotation.NonNull Builder setClientVersion(long value) {
115             checkNotUsed();
116             mBuilderFieldsSet |= 0x1;
117             mClientVersion = value;
118             return this;
119         }
120 
121         @DataClass.Generated.Member
setTaskId(long value)122         public @android.annotation.NonNull Builder setTaskId(long value) {
123             checkNotUsed();
124             mBuilderFieldsSet |= 0x2;
125             mTaskId = value;
126             return this;
127         }
128 
129         @DataClass.Generated.Member
setGetNextLatencyNanos(long value)130         public @android.annotation.NonNull Builder setGetNextLatencyNanos(long value) {
131             checkNotUsed();
132             mBuilderFieldsSet |= 0x4;
133             mGetNextLatencyNanos = value;
134             return this;
135         }
136 
137         /** Builds the instance. This builder should not be touched after calling this! */
build()138         public @android.annotation.NonNull ExampleIteratorLatency build() {
139             checkNotUsed();
140             mBuilderFieldsSet |= 0x8; // Mark builder used
141 
142             ExampleIteratorLatency o =
143                     new ExampleIteratorLatency(mClientVersion, mTaskId, mGetNextLatencyNanos);
144             return o;
145         }
146 
checkNotUsed()147         private void checkNotUsed() {
148             if ((mBuilderFieldsSet & 0x8) != 0) {
149                 throw new IllegalStateException(
150                         "This Builder should not be reused. Use a new Builder instance instead");
151             }
152         }
153     }
154 
155     @DataClass.Generated(
156             time = 1710536954249L,
157             codegenVersion = "1.0.23",
158             sourceFile =
159                     "packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/statsd/ExampleIteratorLatency.java",
160             inputSignatures =
161                     "private  long mClientVersion\nprivate  long mTaskId\nprivate  long mGetNextLatencyNanos\nclass ExampleIteratorLatency extends java.lang.Object implements []\n@com.android.ondevicepersonalization.internal.util.DataClass(genBuilder=true, genEqualsHashCode=true)")
162     @Deprecated
__metadata()163     private void __metadata() {}
164 
165     // @formatter:on
166     // End of generated code
167 
168 }
169