14
14
15
15
package com .google .firebase .remoteconfig ;
16
16
17
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .ExperimentDescriptionFieldKey .EXPERIMENT_ID ;
18
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .ExperimentDescriptionFieldKey .VARIANT_ID ;
19
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .ANALYTICS_USER_PROPERTIES ;
20
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .APP_ID ;
21
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .APP_VERSION ;
22
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .COUNTRY_CODE ;
23
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .INSTANCE_ID ;
24
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .INSTANCE_ID_TOKEN ;
25
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .LANGUAGE_CODE ;
26
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .PACKAGE_NAME ;
27
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .PLATFORM_VERSION ;
28
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .SDK_VERSION ;
29
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .RequestFieldKey .TIME_ZONE ;
30
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .ResponseFieldKey .ENTRIES ;
31
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .ResponseFieldKey .EXPERIMENT_DESCRIPTIONS ;
32
- import static com .google .firebase .remoteconfig .RemoteConfigConstants .ResponseFieldKey .STATE ;
33
-
34
17
import androidx .annotation .StringDef ;
35
18
import java .lang .annotation .Retention ;
36
19
import java .lang .annotation .RetentionPolicy ;
41
24
* @author Lucas Png
42
25
* @hide
43
26
*/
44
- public class RemoteConfigConstants {
27
+ public final class RemoteConfigConstants {
45
28
public static final String FETCH_REGEX_URL =
46
29
"https://firebaseremoteconfig.googleapis.com/v1/projects/%s/namespaces/%s:fetch" ;
47
30
@@ -50,17 +33,17 @@ public class RemoteConfigConstants {
50
33
* server.
51
34
*/
52
35
@ StringDef ({
53
- INSTANCE_ID ,
54
- INSTANCE_ID_TOKEN ,
55
- APP_ID ,
56
- COUNTRY_CODE ,
57
- LANGUAGE_CODE ,
58
- PLATFORM_VERSION ,
59
- TIME_ZONE ,
60
- APP_VERSION ,
61
- PACKAGE_NAME ,
62
- SDK_VERSION ,
63
- ANALYTICS_USER_PROPERTIES
36
+ RequestFieldKey . INSTANCE_ID ,
37
+ RequestFieldKey . INSTANCE_ID_TOKEN ,
38
+ RequestFieldKey . APP_ID ,
39
+ RequestFieldKey . COUNTRY_CODE ,
40
+ RequestFieldKey . LANGUAGE_CODE ,
41
+ RequestFieldKey . PLATFORM_VERSION ,
42
+ RequestFieldKey . TIME_ZONE ,
43
+ RequestFieldKey . APP_VERSION ,
44
+ RequestFieldKey . PACKAGE_NAME ,
45
+ RequestFieldKey . SDK_VERSION ,
46
+ RequestFieldKey . ANALYTICS_USER_PROPERTIES
64
47
})
65
48
@ Retention (RetentionPolicy .SOURCE )
66
49
public @interface RequestFieldKey {
@@ -78,7 +61,11 @@ public class RemoteConfigConstants {
78
61
}
79
62
80
63
/** Keys of fields in the Fetch response body from the Firebase Remote Config server. */
81
- @ StringDef ({ENTRIES , EXPERIMENT_DESCRIPTIONS , STATE })
64
+ @ StringDef ({
65
+ ResponseFieldKey .ENTRIES ,
66
+ ResponseFieldKey .EXPERIMENT_DESCRIPTIONS ,
67
+ ResponseFieldKey .STATE
68
+ })
82
69
@ Retention (RetentionPolicy .SOURCE )
83
70
public @interface ResponseFieldKey {
84
71
String ENTRIES = "entries" ;
@@ -90,7 +77,10 @@ public class RemoteConfigConstants {
90
77
* Select keys of fields in the experiment descriptions returned from the Firebase Remote Config
91
78
* server.
92
79
*/
93
- @ StringDef ({EXPERIMENT_ID , VARIANT_ID })
80
+ @ StringDef ({
81
+ ExperimentDescriptionFieldKey .EXPERIMENT_ID ,
82
+ ExperimentDescriptionFieldKey .VARIANT_ID
83
+ })
94
84
@ Retention (RetentionPolicy .SOURCE )
95
85
public @interface ExperimentDescriptionFieldKey {
96
86
String EXPERIMENT_ID = "experimentId" ;
0 commit comments