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
Modifier and TypeClassDescriptionstatic final class
static final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetData()
Gets additional arbitrary fields of the user.@Nullable String
getEmail()
Gets the e-mail address of the user.@Nullable String
getId()
Gets the id of the user.@Nullable String
Gets the IP address of the user.Deprecated.@Nullable String
Gets the segment of the user.@Nullable String
Gets the username of the user.void
serialize
(@NotNull JsonObjectWriter writer, @NotNull ILogger logger) void
Sets additional arbitrary fields of the user.void
Gets the e-mail address of the user.void
Sets the id of the user.void
setIpAddress
(@Nullable String ipAddress) Sets the IP address of the user.void
Deprecated.use {setData(Map)
} insteadvoid
setSegment
(@Nullable String segment) Sets the segment of the user.void
setUnknown
(@Nullable Map<String, Object> unknown) void
setUsername
(@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:
getUnknown
in interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknown
in interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
-
getData()
} instead