Package de.murmelmeister.murmelapi.user
Record Class UserService
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.user.UserService
public record UserService(@NotNull de.murmelmeister.library.database.Database database, @NotNull UserProvider userProvider, @NotNull UserStatsProvider statsProvider, @NotNull UserLoginProvider loginProvider, @NotNull UserSessionProvider sessionProvider, @NotNull UserExcuseProvider userExcuseProvider, @NotNull PunishmentUserProvider punishUserProvider, @NotNull PunishmentAuditProvider punishAuditProvider)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionUserService(@NotNull de.murmelmeister.library.database.Database database, @NotNull UserProvider userProvider, @NotNull UserStatsProvider statsProvider, @NotNull UserLoginProvider loginProvider, @NotNull UserSessionProvider sessionProvider, @NotNull UserExcuseProvider userExcuseProvider, @NotNull PunishmentUserProvider punishUserProvider, @NotNull PunishmentAuditProvider punishAuditProvider) Creates an instance of aUserServicerecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseSession(int userId) @NotNull de.murmelmeister.library.database.Databasedatabase()Returns the value of thedatabaserecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable UserLogingetLastLogin(int userId) final inthashCode()Returns a hash code value for this object.booleanisOnline(int userId) @NotNull User@NotNull UserLoginProviderReturns the value of theloginProviderrecord component.@NotNull PunishmentAuditProviderReturns the value of thepunishAuditProviderrecord component.@NotNull PunishmentUserProviderReturns the value of thepunishUserProviderrecord component.@NotNull UserSessionProviderReturns the value of thesessionProviderrecord component.voidstartSession(int userId, @NotNull InetAddress inetAddress, @Nullable String clientBrand, int protocolVersion) @NotNull UserStatsProviderReturns the value of thestatsProviderrecord component.final StringtoString()Returns a string representation of this record class.@NotNull UserExcuseProviderReturns the value of theuserExcuseProviderrecord component.@NotNull UserProviderReturns the value of theuserProviderrecord component.
-
Constructor Details
-
UserService
public UserService(@NotNull @NotNull de.murmelmeister.library.database.Database database, @NotNull @NotNull UserProvider userProvider, @NotNull @NotNull UserStatsProvider statsProvider, @NotNull @NotNull UserLoginProvider loginProvider, @NotNull @NotNull UserSessionProvider sessionProvider, @NotNull @NotNull UserExcuseProvider userExcuseProvider, @NotNull @NotNull PunishmentUserProvider punishUserProvider, @NotNull @NotNull PunishmentAuditProvider punishAuditProvider) Creates an instance of aUserServicerecord class.- Parameters:
database- the value for thedatabaserecord componentuserProvider- the value for theuserProviderrecord componentstatsProvider- the value for thestatsProviderrecord componentloginProvider- the value for theloginProviderrecord componentsessionProvider- the value for thesessionProviderrecord componentuserExcuseProvider- the value for theuserExcuseProviderrecord componentpunishUserProvider- the value for thepunishUserProviderrecord componentpunishAuditProvider- the value for thepunishAuditProviderrecord component
-
-
Method Details
-
startSession
public void startSession(int userId, @NotNull @NotNull InetAddress inetAddress, @Nullable @Nullable String clientBrand, int protocolVersion) -
closeSession
public void closeSession(int userId) -
join
-
isOnline
public boolean isOnline(int userId) -
getLastLogin
-
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). -
database
@NotNull public @NotNull de.murmelmeister.library.database.Database database()Returns the value of thedatabaserecord component.- Returns:
- the value of the
databaserecord component
-
userProvider
Returns the value of theuserProviderrecord component.- Returns:
- the value of the
userProviderrecord component
-
statsProvider
Returns the value of thestatsProviderrecord component.- Returns:
- the value of the
statsProviderrecord component
-
loginProvider
Returns the value of theloginProviderrecord component.- Returns:
- the value of the
loginProviderrecord component
-
sessionProvider
Returns the value of thesessionProviderrecord component.- Returns:
- the value of the
sessionProviderrecord component
-
userExcuseProvider
Returns the value of theuserExcuseProviderrecord component.- Returns:
- the value of the
userExcuseProviderrecord component
-
punishUserProvider
Returns the value of thepunishUserProviderrecord component.- Returns:
- the value of the
punishUserProviderrecord component
-
punishAuditProvider
Returns the value of thepunishAuditProviderrecord component.- Returns:
- the value of the
punishAuditProviderrecord component
-