Skip to content

Commit edf81be

Browse files
committed
Clean up ctor
1 parent de08936 commit edf81be

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/KeyValueBuilder.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
package com.google.firebase.crashlytics
1818

19-
/** Helper class to enable fluent syntax in [setCustomKeys] */
20-
@Suppress("DEPRECATION")
21-
class KeyValueBuilder(
22-
// TODO(mrober): Remove this param and make ctor internal in 2025.
23-
@Deprecated(message = "The crashlytics instance is no longer needed and will be removed in 2025.")
24-
private val crashlytics: FirebaseCrashlytics? = null
19+
/** Helper class to enable convenient syntax in [setCustomKeys] */
20+
class KeyValueBuilder private constructor(
21+
private val crashlytics: FirebaseCrashlytics?,
22+
private val builder: CustomKeysAndValues.Builder,
2523
) {
26-
private val builder = CustomKeysAndValues.Builder()
24+
@Deprecated("Do not construct this directly. Use `setCustomKeys` instead. To be removed in 2025.")
25+
constructor(crashlytics: FirebaseCrashlytics) : this(crashlytics, CustomKeysAndValues.Builder())
26+
27+
internal constructor() : this(crashlytics = null, CustomKeysAndValues.Builder())
2728

2829
internal fun build(): CustomKeysAndValues = builder.build()
2930

0 commit comments

Comments
 (0)