public final class CrashReportDataFactory
extends java.lang.Object
Also responsible for holding the custom data to send with each report.
Constructor and Description |
---|
CrashReportDataFactory(android.content.Context context,
ACRAConfiguration config,
android.content.SharedPreferences prefs,
java.util.Calendar appStartDate,
Element initialConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
clearCustomData()
Removes all key/value pairs from the custom data field.
|
CrashReportData |
createCrashData(ReportBuilder builder)
Collects crash data.
|
java.lang.String |
getCustomData(java.lang.String key)
Gets the current value for a key in the custom data field.
|
java.lang.String |
putCustomData(java.lang.String key,
java.lang.String value)
Adds a custom key and value to be reported with the generated
CashReportData.
|
java.lang.String |
removeCustomData(java.lang.String key)
Removes a key/value pair from the custom data field.
|
public CrashReportDataFactory(@NonNull android.content.Context context, @NonNull ACRAConfiguration config, @NonNull android.content.SharedPreferences prefs, @NonNull java.util.Calendar appStartDate, @NonNull Element initialConfiguration)
public java.lang.String putCustomData(@NonNull java.lang.String key, java.lang.String value)
Adds a custom key and value to be reported with the generated CashReportData.
The key/value pairs will be stored in the "custom" column, as a text containing one 'key = value' pair on each line.
key
- A key for your custom data.value
- The value associated to your key.public java.lang.String removeCustomData(@NonNull java.lang.String key)
key
- The key of the data to be removed.public void clearCustomData()
public java.lang.String getCustomData(@NonNull java.lang.String key)
key
- The key of the data to be retrieved.@NonNull public CrashReportData createCrashData(@NonNull ReportBuilder builder)
builder
- ReportBuilder for whom to crete the crash report.