public class DeviceSession extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DeviceSession.Builder
Builder for
DeviceSession . |
Modifier and Type | Field and Description |
---|---|
protected String |
country |
protected Date |
created |
protected String |
ipAddress |
protected String |
sessionId |
protected Date |
updated |
Constructor and Description |
---|
DeviceSession(String sessionId)
None
|
DeviceSession(String sessionId,
String ipAddress,
String country,
Date created,
Date updated)
Use
newBuilder to create instances of this class without
specifying values for all optional fields. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getCountry()
The country from which the last activity from this session was made
|
Date |
getCreated()
The time this session was created
|
String |
getIpAddress()
The IP address of the last activity from this session
|
String |
getSessionId()
The session id
|
Date |
getUpdated()
The time of the last activity from this session
|
int |
hashCode() |
static DeviceSession.Builder |
newBuilder(String sessionId)
Returns a new builder for creating an instance of this class.
|
String |
toString() |
String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
protected final String sessionId
protected final String ipAddress
protected final String country
protected final Date created
protected final Date updated
public DeviceSession(String sessionId, String ipAddress, String country, Date created, Date updated)
newBuilder
to create instances of this class without
specifying values for all optional fields.sessionId
- The session id. Must not be null
.ipAddress
- The IP address of the last activity from this session.country
- The country from which the last activity from this
session was made.created
- The time this session was created.updated
- The time of the last activity from this session.IllegalArgumentException
- If any argument does not meet its
preconditions.public DeviceSession(String sessionId)
The default values for unset fields will be used.
sessionId
- The session id. Must not be null
.IllegalArgumentException
- If any argument does not meet its
preconditions.public String getSessionId()
null
.public String getIpAddress()
null
if not present.public String getCountry()
null
if not present.public Date getCreated()
null
if not present.public Date getUpdated()
null
if not present.public static DeviceSession.Builder newBuilder(String sessionId)
sessionId
- The session id. Must not be null
.IllegalArgumentException
- If any argument does not meet its
preconditions.public String toStringMultiline()
The returned String may contain newlines.