diff --git a/sentry-core/src/main/java/io/sentry/core/Breadcrumb.java b/sentry-core/src/main/java/io/sentry/core/Breadcrumb.java index e1132a39d..9d101e943 100644 --- a/sentry-core/src/main/java/io/sentry/core/Breadcrumb.java +++ b/sentry-core/src/main/java/io/sentry/core/Breadcrumb.java @@ -113,6 +113,16 @@ Map getData() { return data; } + /** + * Returns the value of data[key] or null + * + * @return the value or null + */ + @Nullable + public Object getData(final @NotNull String key) { + return data.get(key); + } + /** * Sets an entry to the data's map * diff --git a/sentry-core/src/main/java/io/sentry/core/SentryEvent.java b/sentry-core/src/main/java/io/sentry/core/SentryEvent.java index 65e83ca81..36f439d7f 100644 --- a/sentry-core/src/main/java/io/sentry/core/SentryEvent.java +++ b/sentry-core/src/main/java/io/sentry/core/SentryEvent.java @@ -8,6 +8,7 @@ import java.util.Map; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; public final class SentryEvent implements IUnknownPropertiesConsumer { @@ -192,7 +193,7 @@ public void setSdk(SdkVersion sdk) { this.sdk = sdk; } - List getFingerprints() { + public List getFingerprints() { return fingerprint; } @@ -229,6 +230,13 @@ public void removeTag(@NotNull String key) { } } + public @Nullable String getTag(final @NotNull String key) { + if (tags != null) { + return tags.get(key); + } + return null; + } + public void setTag(String key, String value) { if (tags == null) { tags = new HashMap<>(); @@ -257,6 +265,13 @@ public void removeExtra(@NotNull String key) { } } + public @Nullable Object getExtra(final @NotNull String key) { + if (extra != null) { + return extra.get(key); + } + return null; + } + public Contexts getContexts() { return contexts; } @@ -297,6 +312,13 @@ public void removeModule(@NotNull String key) { } } + public @Nullable String getModule(final @NotNull String key) { + if (modules != null) { + return modules.get(key); + } + return null; + } + public DebugMeta getDebugMeta() { return debugMeta; }