public final class SentryThread extends java.lang.Object implements IUnknownPropertiesConsumer
The Threads Interface specifies threads that were running at the time an event happened. These threads can also contain stack traces.
An event may contain one or more threads in an attribute named `threads`.
The following example illustrates the threads part of the event payload and omits other attributes for simplicity.
```json { "threads": { "values": [ { "id": "0", "name": "main", "crashed": true, "stacktrace": {} } ] } } ```
Constructor and Description |
---|
SentryThread() |
Modifier and Type | Method and Description |
---|---|
void |
acceptUnknownProperties(@NotNull java.util.Map<java.lang.String,java.lang.Object> unknown) |
@Nullable java.lang.Long |
getId()
Gets the Id of the thread.
|
@Nullable java.lang.String |
getName()
Gets the name of the thread.
|
@Nullable java.lang.Integer |
getPriority()
Gets the priority of the thread.
|
@Nullable SentryStackTrace |
getStacktrace()
Gets the stacktrace of the thread.
|
@Nullable java.lang.String |
getState()
Gets the state of the thread.
|
@Nullable java.lang.Boolean |
isCrashed()
Gets whether the crash happened on this thread.
|
@Nullable java.lang.Boolean |
isCurrent()
Get an optional flag to indicate that the thread was in the foreground.
|
@Nullable java.lang.Boolean |
isDaemon()
Gets if this thread is a daemon thread.
|
void |
setCrashed(@Nullable java.lang.Boolean crashed)
Sets whether the crash happened on this thread.
|
void |
setCurrent(@Nullable java.lang.Boolean current)
Sets an optional flag to indicate that the thread was in the foreground.
|
void |
setDaemon(@Nullable java.lang.Boolean daemon)
Sets if this is a daemon thread.
|
void |
setId(@Nullable java.lang.Long id)
Sets the Id of the thread.
|
void |
setName(@Nullable java.lang.String name)
Sets the name of the thread.
|
void |
setPriority(@Nullable java.lang.Integer priority)
Sets the priority of the thread.
|
void |
setStacktrace(@Nullable SentryStackTrace stacktrace)
Sets the stacktrace of the thread.
|
void |
setState(@Nullable java.lang.String state)
Sets the state of the thread.
|
@Nullable public @Nullable java.lang.Long getId()
public void setId(@Nullable @Nullable java.lang.Long id)
id
- the thread id.@Nullable public @Nullable java.lang.String getName()
public void setName(@Nullable @Nullable java.lang.String name)
name
- the name of the thread.@Nullable public @Nullable java.lang.Boolean isCrashed()
public void setCrashed(@Nullable @Nullable java.lang.Boolean crashed)
crashed
- whether it was the crashed thread.@Nullable public @Nullable java.lang.Boolean isCurrent()
public void setCurrent(@Nullable @Nullable java.lang.Boolean current)
current
- whether the thread was in the foreground.@Nullable public @Nullable SentryStackTrace getStacktrace()
public void setStacktrace(@Nullable @Nullable SentryStackTrace stacktrace)
stacktrace
- the thread stacktrace.@Nullable public @Nullable java.lang.Integer getPriority()
public void setPriority(@Nullable @Nullable java.lang.Integer priority)
priority
- of the thread.@Nullable public @Nullable java.lang.Boolean isDaemon()
public void setDaemon(@Nullable @Nullable java.lang.Boolean daemon)
daemon
- true if the thread is daemon thread. Otherwise false.@Nullable public @Nullable java.lang.String getState()
public void setState(@Nullable @Nullable java.lang.String state)
state
- the state of the thread.@ApiStatus.Internal public void acceptUnknownProperties(@NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> unknown)
acceptUnknownProperties
in interface IUnknownPropertiesConsumer