Package io.sentry.protocol
Class User
- java.lang.Object
-
- io.sentry.protocol.User
-
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
public final class User extends java.lang.Object implements JsonUnknown, JsonSerializable
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 Classes Modifier and Type Class Description static class
User.Deserializer
static class
User.JsonKeys
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.String
getEmail()
Gets the e-mail address of the user.@Nullable java.lang.String
getId()
Gets the id of the user.@Nullable java.lang.String
getIpAddress()
Gets the IP address of the user.@Nullable java.util.Map<java.lang.String,@NotNull java.lang.String>
getOthers()
Gets other user related data.@Nullable java.util.Map<java.lang.String,java.lang.Object>
getUnknown()
@Nullable java.lang.String
getUsername()
Gets the username of the user.void
serialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger)
void
setEmail(@Nullable java.lang.String email)
Gets the e-mail address of the user.void
setId(@Nullable java.lang.String id)
Sets the id of the user.void
setIpAddress(@Nullable java.lang.String ipAddress)
Sets the IP address of the user.void
setOthers(@Nullable java.util.Map<java.lang.String,@NotNull java.lang.String> other)
Sets other user related data.void
setUnknown(@Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
void
setUsername(@Nullable java.lang.String username)
Sets the username of the user.
-
-
-
Constructor Detail
-
User
public User()
-
User
public User(@NotNull @NotNull User user)
-
-
Method Detail
-
getEmail
@Nullable public @Nullable java.lang.String getEmail()
Gets the e-mail address of the user.- Returns:
- the e-mail.
-
setEmail
public void setEmail(@Nullable @Nullable java.lang.String email)
Gets the e-mail address of the user.- Parameters:
email
- the e-mail.
-
getId
@Nullable public @Nullable java.lang.String getId()
Gets the id of the user.- Returns:
- the id.
-
setId
public void setId(@Nullable @Nullable java.lang.String id)
Sets the id of the user.- Parameters:
id
- the user id.
-
getUsername
@Nullable public @Nullable java.lang.String getUsername()
Gets the username of the user.- Returns:
- the username.
-
setUsername
public void setUsername(@Nullable @Nullable java.lang.String username)
Sets the username of the user.- Parameters:
username
- the username.
-
getIpAddress
@Nullable public @Nullable java.lang.String getIpAddress()
Gets the IP address of the user.- Returns:
- the IP address of the user.
-
setIpAddress
public void setIpAddress(@Nullable @Nullable java.lang.String ipAddress)
Sets the IP address of the user.- Parameters:
ipAddress
- the IP address of the user.
-
getOthers
@Nullable public @Nullable java.util.Map<java.lang.String,@NotNull java.lang.String> getOthers()
Gets other user related data.- Returns:
- the other user data.
-
setOthers
public void setOthers(@Nullable @Nullable java.util.Map<java.lang.String,@NotNull java.lang.String> other)
Sets other user related data.- Parameters:
other
- the other user related data..
-
getUnknown
@Nullable public @Nullable java.util.Map<java.lang.String,java.lang.Object> getUnknown()
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
public void setUnknown(@Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
- Specified by:
setUnknown
in interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws java.io.IOException
- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
-