public final class Scope
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
Scope(@NotNull SentryOptions options)
Scope's ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb)
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if
set
|
void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if
set
|
void |
addEventProcessor(@NotNull EventProcessor eventProcessor)
Adds an event processor to the Scope's event processors list
|
void |
clear()
Resets the Scope to its default state
|
void |
clearBreadcrumbs()
Clear all the breadcrumbs
|
@NotNull Scope |
clone()
Clones a Scope aka deep copy
|
@NotNull Contexts |
getContexts()
Returns the Scope's contexts
|
@Nullable SentryLevel |
getLevel()
Returns the Scope's SentryLevel
|
@Nullable java.lang.String |
getTransaction()
Returns the Scope's transaction
|
@Nullable User |
getUser()
Returns the Scope's user
|
void |
removeContexts(@NotNull java.lang.String key)
Removes a value from the Scope's contexts
|
void |
removeExtra(@NotNull java.lang.String key)
Removes an extra from the Scope's extras
|
void |
removeTag(@NotNull java.lang.String key)
Removes a tag from the Scope's tags
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Boolean value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Number value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.Object value)
Sets the Scope's contexts
|
void |
setContexts(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the Scope's contexts
|
void |
setExtra(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets an extra to the Scope's extra map
|
void |
setFingerprint(@NotNull java.util.List<java.lang.String> fingerprint)
Sets the Scope's fingerprint list
|
void |
setLevel(@Nullable SentryLevel level)
Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the event
|
void |
setTag(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets a tag to Scope's tags
|
void |
setTransaction(@Nullable java.lang.String transaction)
Sets the Scope's transaction
|
void |
setUser(@Nullable User user)
Sets the Scope's user
|
public Scope(@NotNull @NotNull SentryOptions options)
options
- the options@Nullable public @Nullable SentryLevel getLevel()
public void setLevel(@Nullable @Nullable SentryLevel level)
level
- the SentryLevel@Nullable public @Nullable java.lang.String getTransaction()
public void setTransaction(@Nullable @Nullable java.lang.String transaction)
transaction
- the transaction@Nullable public @Nullable User getUser()
public void setUser(@Nullable @Nullable User user)
user
- the userpublic void setFingerprint(@NotNull @NotNull java.util.List<java.lang.String> fingerprint)
fingerprint
- the fingerprint listpublic void addBreadcrumb(@NotNull @NotNull Breadcrumb breadcrumb, @Nullable @Nullable java.lang.Object hint)
breadcrumb
- the breadcrumbhint
- the hintpublic void addBreadcrumb(@NotNull @NotNull Breadcrumb breadcrumb)
breadcrumb
- the breadcrumbpublic void clearBreadcrumbs()
public void clear()
public void setTag(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
key
- the keyvalue
- the valuepublic void removeTag(@NotNull @NotNull java.lang.String key)
key
- the keypublic void setExtra(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
key
- the keyvalue
- the valuepublic void removeExtra(@NotNull @NotNull java.lang.String key)
key
- the key@NotNull public @NotNull Contexts getContexts()
public void setContexts(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.Object value)
key
- the context keyvalue
- the context valuepublic void setContexts(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.Boolean value)
key
- the context keyvalue
- the context valuepublic void setContexts(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
key
- the context keyvalue
- the context valuepublic void setContexts(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.Number value)
key
- the context keyvalue
- the context valuepublic void removeContexts(@NotNull @NotNull java.lang.String key)
key
- the Key@NotNull public @NotNull Scope clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if object is not cloneablepublic void addEventProcessor(@NotNull @NotNull EventProcessor eventProcessor)
eventProcessor
- the event processor