Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

added missing getters on Breadcrumb and SentryEvent #397

Merged
merged 2 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sentry-core/src/main/java/io/sentry/core/Breadcrumb.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ Map<String, Object> 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
*
Expand Down
29 changes: 29 additions & 0 deletions sentry-core/src/main/java/io/sentry/core/SentryEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -196,6 +197,13 @@ List<String> getFingerprints() {
return fingerprint;
}

public boolean hasFingerprint(final @NotNull String fingerprint) {
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
if (this.fingerprint != null) {
return this.fingerprint.contains(fingerprint);
}
return false;
}

public void setFingerprints(List<String> fingerprint) {
this.fingerprint = fingerprint;
}
Expand Down Expand Up @@ -229,6 +237,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<>();
Expand Down Expand Up @@ -257,6 +272,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;
}
Expand Down Expand Up @@ -297,6 +319,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;
}
Expand Down