Package com.axelor.auth
Record Class UserSession.Device
java.lang.Object
java.lang.Record
com.axelor.auth.UserSession.Device
- Record Components:
remoteIp- IP address of the clientbrowser- browser family name (e.g."Chrome"), ornullif unknownos- operating system family name (e.g."Linux"), ornullif unknowndevice- device family name (e.g."Desktop"), ornullif unknown
- Enclosing class:
UserSession
public static record UserSession.Device(String remoteIp, String browser, String os, String device)
extends Record
Device and network information
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbrowser()Returns the value of thebrowserrecord 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.static UserSession.Deviceof(String remoteIp, UserAgentParser.UserAgentInfo ua) Creates aUserSession.Devicefrom a remote IP and a parsed User-Agent.static UserSession.DeviceCreates aUserSession.Devicewith only the IP address, when User-Agent parsing is unavailable.os()Returns the value of theosrecord component.remoteIp()Returns the value of theremoteIprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates aUserSession.Devicefrom a remote IP and a parsed User-Agent.- Parameters:
remoteIp- client IP addressua- parsed User-Agent info- Returns:
- a fully populated
UserSession.Device
-
ofIpOnly
Creates aUserSession.Devicewith only the IP address, when User-Agent parsing is unavailable.- Parameters:
remoteIp- client IP address- Returns:
- a
UserSession.Devicewithnullbrowser, os, and device fields
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
remoteIp
Returns the value of theremoteIprecord component.- Returns:
- the value of the
remoteIprecord component
-
browser
Returns the value of thebrowserrecord component.- Returns:
- the value of the
browserrecord component
-
os
Returns the value of theosrecord component.- Returns:
- the value of the
osrecord component
-
device
Returns the value of thedevicerecord component.- Returns:
- the value of the
devicerecord component
-