Package io.constructor.client
Class UserInfo
java.lang.Object
io.constructor.client.UserInfo
Constructor.io User Info
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
void
setClientId
(String clientId) Validates and sets the client idvoid
setForwardedFor
(String forwardedFor) Validates and sets forwarding info for the end user's device if proxying requestsvoid
setSessionId
(int sessionId) Validates and sets the session idvoid
setUserAgent
(String userAgent) Validates and sets the end user's User-Agentvoid
Validates and sets the the user id according to the API consumer (for logged in users)void
setUserSegments
(List<String> userSegments) Validates and sets the the user segments according to the API consumer
-
Constructor Details
-
UserInfo
Creates a User Info object- Parameters:
sessionId
- the user's Session IDclientId
- the user's Client ID
-
UserInfo
public UserInfo()Creates a User Info object
-
-
Method Details
-
getClientId
- Returns:
- Client ID
-
getSessionId
public int getSessionId()- Returns:
- Session ID
-
getUserId
- Returns:
- User ID
-
getUserSegments
- Returns:
- User Segments
-
getForwardedFor
- Returns:
- Forwarding info for the end user's device if proxying requests
-
getUserAgent
- Returns:
- Forwarding info for the end user's User-Agent if proxying requests
-
setSessionId
Validates and sets the session id- Parameters:
sessionId
- the user's session id- Throws:
IllegalArgumentException
-
setClientId
Validates and sets the client id- Parameters:
clientId
- the user's client id- Throws:
IllegalArgumentException
-
setUserId
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
Validates and sets the the user segments according to the API consumer- Parameters:
userSegments
- the userSegments to set
-
setForwardedFor
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
Validates and sets the end user's User-Agent- Parameters:
userAgent
- the end user's User-Agent- Throws:
IllegalArgumentException
-