Class UserInfo

java.lang.Object
io.constructor.client.UserInfo

public class UserInfo extends Object
Constructor.io User Info
  • Constructor Details

    • UserInfo

      public UserInfo(int sessionId, String clientId)
      Creates a User Info object
      Parameters:
      sessionId - the user's Session ID
      clientId - the user's Client ID
    • UserInfo

      public UserInfo()
      Creates a User Info object
  • Method Details

    • getClientId

      public String getClientId()
      Returns:
      Client ID
    • getSessionId

      public int getSessionId()
      Returns:
      Session ID
    • getUserId

      public String getUserId()
      Returns:
      User ID
    • getUserSegments

      public List<String> getUserSegments()
      Returns:
      User Segments
    • getForwardedFor

      public String getForwardedFor()
      Returns:
      Forwarding info for the end user's device if proxying requests
    • getUserAgent

      public String getUserAgent()
      Returns:
      Forwarding info for the end user's User-Agent if proxying requests
    • setSessionId

      public void setSessionId(int sessionId) throws IllegalArgumentException
      Validates and sets the session id
      Parameters:
      sessionId - the user's session id
      Throws:
      IllegalArgumentException
    • setClientId

      public void setClientId(String clientId) throws IllegalArgumentException
      Validates and sets the client id
      Parameters:
      clientId - the user's client id
      Throws:
      IllegalArgumentException
    • setUserId

      public void setUserId(String userId) throws IllegalArgumentException
      Validates and sets the the user id according to the API consumer (for logged in users)
      Parameters:
      userId - the user's id
      Throws:
      IllegalArgumentException
    • setUserSegments

      public void setUserSegments(List<String> userSegments)
      Validates and sets the the user segments according to the API consumer
      Parameters:
      userSegments - the userSegments to set
    • setForwardedFor

      public void setForwardedFor(String forwardedFor) throws IllegalArgumentException
      Validates and sets forwarding info for the end user's device if proxying requests
      Parameters:
      forwardedFor - the end user's forwarding info
      Throws:
      IllegalArgumentException
    • setUserAgent

      public void setUserAgent(String userAgent) throws IllegalArgumentException
      Validates and sets the end user's User-Agent
      Parameters:
      userAgent - the end user's User-Agent
      Throws:
      IllegalArgumentException