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 com.android.adservices.service.stats; 18 19 import android.annotation.Nullable; 20 21 import com.google.auto.value.AutoValue; 22 23 import java.util.List; 24 25 /** 26 * Class for AdServicesGetTopicsReported atom (for T+ logging) and 27 * AdServicesBackCompatGetTopicsReported atom (for R+ logging). 28 * 29 * <p>See go/rbc-ww-logging for more details. 30 */ 31 @AutoValue 32 public abstract class GetTopicsReportedStats { 33 /** 34 * @return list of topic ids returned. 35 */ 36 @Nullable getTopicIds()37 public abstract List<Integer> getTopicIds(); 38 39 /** @return number of topic ids filtered due to duplication. */ getDuplicateTopicCount()40 public abstract int getDuplicateTopicCount(); 41 42 /** @return number of topic ids filtered due to being blocked. */ getFilteredBlockedTopicCount()43 public abstract int getFilteredBlockedTopicCount(); 44 45 /** @return number of topic ids returned. */ getTopicIdsCount()46 public abstract int getTopicIdsCount(); 47 48 /** @return generic builder. */ builder()49 public static GetTopicsReportedStats.Builder builder() { 50 return new AutoValue_GetTopicsReportedStats.Builder(); 51 } 52 53 /** Builder class for {@link GetTopicsReportedStats}. */ 54 @AutoValue.Builder 55 public abstract static class Builder { 56 /** Set list of topic ids returned. */ setTopicIds(List<Integer> value)57 public abstract GetTopicsReportedStats.Builder setTopicIds(List<Integer> value); 58 59 /** Set duplicate topic count. */ setDuplicateTopicCount(int value)60 public abstract GetTopicsReportedStats.Builder setDuplicateTopicCount(int value); 61 62 /** Set filtered blocked topic count. */ setFilteredBlockedTopicCount(int value)63 public abstract GetTopicsReportedStats.Builder setFilteredBlockedTopicCount(int value); 64 65 /** Set number of topic ids returned. */ setTopicIdsCount(int value)66 public abstract GetTopicsReportedStats.Builder setTopicIdsCount(int value); 67 68 /** build for {@link GetTopicsReportedStats}. */ build()69 public abstract GetTopicsReportedStats build(); 70 } 71 } 72