Skip to content

Commit 1595a03

Browse files
committed
Format files
1 parent 7d782ac commit 1595a03

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigFetchHandler.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds) {
162162

163163
// Make a copy to prevent any concurrency issues between Fetches.
164164
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);
166166

167167
return fetchedConfigsCache
168168
.get()
@@ -199,18 +199,18 @@ public Task<FetchResponse> fetch(long minimumFetchIntervalInSeconds) {
199199
* <li>The backend responded with unavailable errors for the last two fetch requests.
200200
* </ul>
201201
*
202+
* @param {@link FetchType} and fetchAttemptNumber help detail what started the fetch call.
202203
* @return A {@link Task} representing an immediate fetch call that returns a {@link
203204
* FetchResponse} with the configs fetched from the backend. If the backend was not called or
204205
* 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.
206206
*/
207207
public Task<FetchResponse> fetchNowWithTypeAndAttemptNumber(
208208
FetchType fetchType, int fetchAttemptNumber) {
209209

210210
// Make a copy to prevent any concurrency issues between Fetches.
211211
Map<String, String> copyOfCustomHttpHeaders = new HashMap<>(customHttpHeaders);
212212
copyOfCustomHttpHeaders.put(
213-
X_FIREBASE_RC_FETCH_TYPE, fetchType.toString() + "/" + fetchAttemptNumber);
213+
X_FIREBASE_RC_FETCH_TYPE, fetchType.getValue() + "/" + fetchAttemptNumber);
214214

215215
return fetchedConfigsCache
216216
.get()
@@ -693,12 +693,17 @@ public ConfigContainer getFetchedConfigs() {
693693
}
694694

695695
public enum FetchType {
696-
BASE,
697-
REALTIME;
696+
BASE("Base"),
697+
REALTIME("Realtime");
698698

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;
702707
}
703708
}
704709
}

0 commit comments

Comments
 (0)