Record Class UserLogin
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.user.login.UserLogin
- Record Components:
id- Unique identifier for the login recorduserId- ID of the user who logged inloginTime- Timestamp of when the user logged inlogoutTime- Timestamp of when the user logged out (nullable)ipAddress- IP address from which the user logged inclientBrand- Brand of the client used for loginprotocolVersion- Version of the protocol used for login
public record UserLogin(UUID id, int userId, LocalDateTime loginTime, LocalDateTime logoutTime, String ipAddress, String clientBrand, int protocolVersion)
extends Record
Represents a user login record, including login and logout times, IP address, client brand, and protocol version.
This record is immutable and provides a concise way to store user login information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theclientBrandrecord component.private final UUIDThe field for theidrecord component.private final StringThe field for theipAddressrecord component.private final LocalDateTimeThe field for theloginTimerecord component.private final LocalDateTimeThe field for thelogoutTimerecord component.private final intThe field for theprotocolVersionrecord component.private final intThe field for theuserIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionUserLogin(UUID id, int userId, LocalDateTime loginTime, LocalDateTime logoutTime, String ipAddress, String clientBrand, int protocolVersion) Creates an instance of aUserLoginrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclientBrandrecord 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.Returns the value of theipAddressrecord component.Returns the value of theloginTimerecord component.Returns the value of thelogoutTimerecord component.intReturns the value of theprotocolVersionrecord component.final StringtoString()Returns a string representation of this record class.intuserId()Returns the value of theuserIdrecord component.
-
Field Details
-
id
The field for theidrecord component. -
userId
private final int userIdThe field for theuserIdrecord component. -
loginTime
The field for theloginTimerecord component. -
logoutTime
The field for thelogoutTimerecord component. -
ipAddress
The field for theipAddressrecord component. -
clientBrand
The field for theclientBrandrecord component. -
protocolVersion
private final int protocolVersionThe field for theprotocolVersionrecord component.
-
-
Constructor Details
-
UserLogin
public UserLogin(UUID id, int userId, LocalDateTime loginTime, LocalDateTime logoutTime, String ipAddress, String clientBrand, int protocolVersion) Creates an instance of aUserLoginrecord class.- Parameters:
id- the value for theidrecord componentuserId- the value for theuserIdrecord componentloginTime- the value for theloginTimerecord componentlogoutTime- the value for thelogoutTimerecord componentipAddress- the value for theipAddressrecord componentclientBrand- the value for theclientBrandrecord componentprotocolVersion- the value for theprotocolVersionrecord 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
-
userId
public int userId()Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
loginTime
Returns the value of theloginTimerecord component.- Returns:
- the value of the
loginTimerecord component
-
logoutTime
Returns the value of thelogoutTimerecord component.- Returns:
- the value of the
logoutTimerecord component
-
ipAddress
Returns the value of theipAddressrecord component.- Returns:
- the value of the
ipAddressrecord component
-
clientBrand
Returns the value of theclientBrandrecord component.- Returns:
- the value of the
clientBrandrecord component
-
protocolVersion
public int protocolVersion()Returns the value of theprotocolVersionrecord component.- Returns:
- the value of the
protocolVersionrecord component
-