Package com.axelor.auth
Record Class UserSession
java.lang.Object
java.lang.Record
com.axelor.auth.UserSession
- Record Components:
id- session identifierloginDate- epoch milliseconds of the initial authentication, or0if unavailablelastAccess- epoch milliseconds of the last request made on this session, or0if unavailablecurrent-trueif this session belongs to the currently connected userdevice- device and network information associated with this session
public record UserSession(String id, long loginDate, long lastAccess, boolean current, UserSession.Device device)
extends Record
Represents an active user session
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDevice and network information -
Constructor Summary
ConstructorsConstructorDescriptionUserSession(String id, long loginDate, long lastAccess, boolean current, UserSession.Device device) Creates an instance of aUserSessionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancurrent()Returns the value of thecurrentrecord component.device()Returns the value of thedevicerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.longReturns the value of thelastAccessrecord component.longReturns the value of theloginDaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UserSession
public UserSession(String id, long loginDate, long lastAccess, boolean current, UserSession.Device device) Creates an instance of aUserSessionrecord class.- Parameters:
id- the value for theidrecord componentloginDate- the value for theloginDaterecord componentlastAccess- the value for thelastAccessrecord componentcurrent- the value for thecurrentrecord componentdevice- the value for thedevicerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
loginDate
public long loginDate()Returns the value of theloginDaterecord component.- Returns:
- the value of the
loginDaterecord component
-
lastAccess
public long lastAccess()Returns the value of thelastAccessrecord component.- Returns:
- the value of the
lastAccessrecord component
-
current
public boolean current()Returns the value of thecurrentrecord component.- Returns:
- the value of the
currentrecord component
-
device
Returns the value of thedevicerecord component.- Returns:
- the value of the
devicerecord component
-