• 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 com.android.adservices.service.stats;
18 
19 import android.annotation.NonNull;
20 
21 import java.util.Objects;
22 
23 /** class for measurement delayed source registration stats. */
24 public class MeasurementDelayedSourceRegistrationStats {
25     private int mCode;
26     private int mRegistrationStatus;
27     private long mRegistrationDelay;
28 
MeasurementDelayedSourceRegistrationStats()29     public MeasurementDelayedSourceRegistrationStats() {}
30 
31     @Override
equals(Object obj)32     public boolean equals(Object obj) {
33         if (!(obj instanceof MeasurementDelayedSourceRegistrationStats)) {
34             return false;
35         }
36         MeasurementDelayedSourceRegistrationStats measurementDelayedSourceRegistrationStats =
37                 (MeasurementDelayedSourceRegistrationStats) obj;
38         return mCode == measurementDelayedSourceRegistrationStats.getCode()
39                 && mRegistrationStatus
40                         == measurementDelayedSourceRegistrationStats.getRegistrationStatus()
41                 && mRegistrationDelay
42                         == measurementDelayedSourceRegistrationStats.getRegistrationDelay();
43     }
44 
45     @Override
hashCode()46     public int hashCode() {
47         return Objects.hash(mCode, mRegistrationStatus, mRegistrationDelay);
48     }
49 
getCode()50     public int getCode() {
51         return mCode;
52     }
53 
getRegistrationStatus()54     public int getRegistrationStatus() {
55         return mRegistrationStatus;
56     }
57 
getRegistrationDelay()58     public long getRegistrationDelay() {
59         return mRegistrationDelay;
60     }
61 
62     /** Builder for {@link MeasurementDelayedSourceRegistrationStats}. */
63     public static final class Builder {
64         private final MeasurementDelayedSourceRegistrationStats mBuilding;
65 
Builder()66         public Builder() {
67             mBuilding = new MeasurementDelayedSourceRegistrationStats();
68         }
69 
70         /** See {@link MeasurementDelayedSourceRegistrationStats#getCode()} . */
setCode(int code)71         public @NonNull MeasurementDelayedSourceRegistrationStats.Builder setCode(int code) {
72             mBuilding.mCode = code;
73             return this;
74         }
75 
76         /** See {@link MeasurementDelayedSourceRegistrationStats#getRegistrationStatus()} . */
setRegistrationStatus( int registrationStatus)77         public @NonNull MeasurementDelayedSourceRegistrationStats.Builder setRegistrationStatus(
78                 int registrationStatus) {
79             mBuilding.mRegistrationStatus = registrationStatus;
80             return this;
81         }
82 
83         /** See {@link MeasurementDelayedSourceRegistrationStats#getRegistrationDelay()} . */
setRegistrationDelay( long registrationDelay)84         public @NonNull MeasurementDelayedSourceRegistrationStats.Builder setRegistrationDelay(
85                 long registrationDelay) {
86             mBuilding.mRegistrationDelay = registrationDelay;
87             return this;
88         }
89         /** Build the {@link MeasurementDelayedSourceRegistrationStats}. */
build()90         public @NonNull MeasurementDelayedSourceRegistrationStats build() {
91             return mBuilding;
92         }
93     }
94 }
95