Class User

java.lang.Object
io.sentry.protocol.User
All Implemented Interfaces:
JsonSerializable, JsonUnknown

public final class User extends 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" } } ```

  • Constructor Details

    • User

      public User()
    • User

      public User(@NotNull @NotNull User user)
  • Method Details

    • getEmail

      @Nullable public @Nullable String getEmail()
      Gets the e-mail address of the user.
      Returns:
      the e-mail.
    • setEmail

      public void setEmail(@Nullable @Nullable String email)
      Gets the e-mail address of the user.
      Parameters:
      email - the e-mail.
    • getId

      @Nullable public @Nullable String getId()
      Gets the id of the user.
      Returns:
      the id.
    • setId

      public void setId(@Nullable @Nullable String id)
      Sets the id of the user.
      Parameters:
      id - the user id.
    • getUsername

      @Nullable public @Nullable String getUsername()
      Gets the username of the user.
      Returns:
      the username.
    • setUsername

      public void setUsername(@Nullable @Nullable String username)
      Sets the username of the user.
      Parameters:
      username - the username.
    • getSegment

      @Nullable public @Nullable String getSegment()
      Gets the segment of the user.
      Returns:
      the user segment.
    • setSegment

      public void setSegment(@Nullable @Nullable String segment)
      Sets the segment of the user.
      Parameters:
      segment - the segment.
    • getIpAddress

      @Nullable public @Nullable String getIpAddress()
      Gets the IP address of the user.
      Returns:
      the IP address of the user.
    • setIpAddress

      public void setIpAddress(@Nullable @Nullable String ipAddress)
      Sets the IP address of the user.
      Parameters:
      ipAddress - the IP address of the user.
    • getOthers

      @Deprecated @Nullable public @Nullable Map<String,@NotNull String> getOthers()
      Deprecated.
      use {getData()} instead
      Gets other user related data.
      Returns:
      the other user data.
    • setOthers

      @Deprecated public void setOthers(@Nullable @Nullable Map<String,@NotNull String> other)
      Deprecated.
      use {setData(Map)} instead
      Sets other user related data.
      Parameters:
      other - the other user related data..
    • getData

      @Nullable public @Nullable Map<String,@NotNull String> getData()
      Gets additional arbitrary fields of the user.
      Returns:
      the other user data.
    • setData

      public void setData(@Nullable @Nullable Map<String,@NotNull String> data)
      Sets additional arbitrary fields of the user.
      Parameters:
      data - the other user related data..
    • getUnknown

      @Nullable public @Nullable Map<String,Object> getUnknown()
      Specified by:
      getUnknown in interface JsonUnknown
    • setUnknown

      public void setUnknown(@Nullable @Nullable Map<String,Object> unknown)
      Specified by:
      setUnknown in interface JsonUnknown
    • serialize

      public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException
      Specified by:
      serialize in interface JsonSerializable
      Throws:
      IOException