Package io.sentry.protocol
Class User
java.lang.Object
io.sentry.protocol.User
- All Implemented Interfaces:
JsonSerializable,JsonUnknown
Information about the user who triggered an event.
```json { "user": { "id": "unique_id", "username": "my_user", "email": "[email protected]", "ip_address": "127.0.0.1", "subscription": "basic" } } ```
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()Gets additional arbitrary fields of the user.@Nullable StringgetEmail()Gets the e-mail address of the user.@Nullable StringgetId()Gets the id of the user.@Nullable StringGets the IP address of the user.Deprecated.@Nullable StringGets the segment of the user.@Nullable StringGets the username of the user.voidserialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger) voidSets additional arbitrary fields of the user.voidGets the e-mail address of the user.voidSets the id of the user.voidsetIpAddress(@Nullable String ipAddress) Sets the IP address of the user.voidDeprecated.use {setData(Map)} insteadvoidsetSegment(@Nullable String segment) Sets the segment of the user.voidsetUnknown(@Nullable Map<String, Object> unknown) voidsetUsername(@Nullable String username) Sets the username of the user.
-
Constructor Details
-
User
public User() -
User
-
-
Method Details
-
getEmail
Gets the e-mail address of the user.- Returns:
- the e-mail.
-
setEmail
Gets the e-mail address of the user.- Parameters:
email- the e-mail.
-
getId
Gets the id of the user.- Returns:
- the id.
-
setId
Sets the id of the user.- Parameters:
id- the user id.
-
getUsername
Gets the username of the user.- Returns:
- the username.
-
setUsername
Sets the username of the user.- Parameters:
username- the username.
-
getSegment
Gets the segment of the user.- Returns:
- the user segment.
-
setSegment
Sets the segment of the user.- Parameters:
segment- the segment.
-
getIpAddress
Gets the IP address of the user.- Returns:
- the IP address of the user.
-
setIpAddress
Sets the IP address of the user.- Parameters:
ipAddress- the IP address of the user.
-
getOthers
Deprecated.use {getData()} insteadGets other user related data.- Returns:
- the other user data.
-
setOthers
Deprecated.use {setData(Map)} insteadSets other user related data.- Parameters:
other- the other user related data..
-
getData
Gets additional arbitrary fields of the user.- Returns:
- the other user data.
-
setData
Sets additional arbitrary fields of the user.- Parameters:
data- the other user related data..
-
getUnknown
- Specified by:
getUnknownin interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknownin interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-
getData()} instead