@@ -162,7 +162,7 @@ public Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds) {
162
162
163
163
// Make a copy to prevent any concurrency issues between Fetches.
164
164
Map <String , String > copyOfCustomHttpHeaders = new HashMap <>(customHttpHeaders );
165
- copyOfCustomHttpHeaders .put (X_FIREBASE_RC_FETCH_TYPE , FetchType .BASE .toString () + "/" + 1 );
165
+ copyOfCustomHttpHeaders .put (X_FIREBASE_RC_FETCH_TYPE , FetchType .BASE .getValue () + "/" + 1 );
166
166
167
167
return fetchedConfigsCache
168
168
.get ()
@@ -199,18 +199,18 @@ public Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds) {
199
199
* <li>The backend responded with unavailable errors for the last two fetch requests.
200
200
* </ul>
201
201
*
202
+ * @param {@link FetchType} and fetchAttemptNumber help detail what started the fetch call.
202
203
* @return A {@link Task} representing an immediate fetch call that returns a {@link
203
204
* FetchResponse} with the configs fetched from the backend. If the backend was not called or
204
205
* the backend had no updates, the {@link FetchResponse}'s configs will be {@code null}.
205
- * FetchType and fetchAttemptNumber help detail what started the fetch call.
206
206
*/
207
207
public Task <FetchResponse > fetchNowWithTypeAndAttemptNumber (
208
208
FetchType fetchType , int fetchAttemptNumber ) {
209
209
210
210
// Make a copy to prevent any concurrency issues between Fetches.
211
211
Map <String , String > copyOfCustomHttpHeaders = new HashMap <>(customHttpHeaders );
212
212
copyOfCustomHttpHeaders .put (
213
- X_FIREBASE_RC_FETCH_TYPE , fetchType .toString () + "/" + fetchAttemptNumber );
213
+ X_FIREBASE_RC_FETCH_TYPE , fetchType .getValue () + "/" + fetchAttemptNumber );
214
214
215
215
return fetchedConfigsCache
216
216
.get ()
@@ -693,12 +693,17 @@ public ConfigContainer getFetchedConfigs() {
693
693
}
694
694
695
695
public enum FetchType {
696
- BASE ,
697
- REALTIME ;
696
+ BASE ( "Base" ) ,
697
+ REALTIME ( "Realtime" ) ;
698
698
699
- @ Override
700
- public String toString () {
701
- return name ().charAt (0 ) + name ().substring (1 ).toLowerCase ();
699
+ private final String value ;
700
+
701
+ FetchType (String value ) {
702
+ this .value = value ;
703
+ }
704
+
705
+ String getValue () {
706
+ return value ;
702
707
}
703
708
}
704
709
}
0 commit comments