• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
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 package com.google.android.libraries.mobiledatadownload;
17 
18 import com.google.auto.value.AutoValue;
19 import com.google.common.base.Optional;
20 import com.google.errorprone.annotations.CheckReturnValue;
21 
22 /** Configuration values for experimentation in MDD. */
23 @CheckReturnValue
24 @AutoValue
25 public abstract class ExperimentationConfig {
26 
27   /**
28    * Returns the log source to which download stage experiment IDS will be added as external
29    * experiment IDs.
30    */
getHostAppLogSource()31   public abstract Optional<String> getHostAppLogSource();
32 
33   /**
34    * Returns the primes log source to which download stage experiment IDs will be added as external
35    * experiment IDs. This will allow slicing primes metrics to MDD rollouts.
36    */
getPrimesLogSource()37   public abstract Optional<String> getPrimesLogSource();
38 
39   // TODO(b/201463803): add per-file-group overrides.
40 
builder()41   public static Builder builder() {
42     return new AutoValue_ExperimentationConfig.Builder();
43   }
44 
45   /** Builder for ExperimentationConfig. */
46   @AutoValue.Builder
47   public abstract static class Builder {
48 
49     /**
50      * Sets the host app log source. Download stage experiment ids will be added as external
51      * experiment ids to this log source.
52      *
53      * <p>Optional.
54      *
55      * @param hostAppLogSource the name of the host app log source.
56      */
setHostAppLogSource(String hostAppLogSource)57     public abstract Builder setHostAppLogSource(String hostAppLogSource);
58 
59     /**
60      * Sets the host app primes log source. Download stage experiment ids will be added as external
61      * experiment ids to this log source. This will allow slicing primes metrics to MDD roll outs.
62      * See <internal> for more details.
63      *
64      * <p>Optional.
65      *
66      * @param primesLogSource the name of the primes log source
67      */
setPrimesLogSource(String primesLogSource)68     public abstract Builder setPrimesLogSource(String primesLogSource);
69 
build()70     public abstract ExperimentationConfig build();
71   }
72 }
73