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 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 a UserService record class.
      Parameters:
      database - the value for the database record component
      userProvider - the value for the userProvider record component
      statsProvider - the value for the statsProvider record component
      loginProvider - the value for the loginProvider record component
      sessionProvider - the value for the sessionProvider record component
      userExcuseProvider - the value for the userExcuseProvider record component
      punishUserProvider - the value for the punishUserProvider record component
      punishAuditProvider - the value for the punishAuditProvider record 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

      @NotNull public @NotNull User join(@NotNull @NotNull UUID uuid, @NotNull @NotNull String username)
    • isOnline

      public boolean isOnline(int userId)
    • getLastLogin

      @Nullable public @Nullable UserLogin getLastLogin(int userId)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • database

      @NotNull public @NotNull de.murmelmeister.library.database.Database database()
      Returns the value of the database record component.
      Returns:
      the value of the database record component
    • userProvider

      @NotNull public @NotNull UserProvider userProvider()
      Returns the value of the userProvider record component.
      Returns:
      the value of the userProvider record component
    • statsProvider

      @NotNull public @NotNull UserStatsProvider statsProvider()
      Returns the value of the statsProvider record component.
      Returns:
      the value of the statsProvider record component
    • loginProvider

      @NotNull public @NotNull UserLoginProvider loginProvider()
      Returns the value of the loginProvider record component.
      Returns:
      the value of the loginProvider record component
    • sessionProvider

      @NotNull public @NotNull UserSessionProvider sessionProvider()
      Returns the value of the sessionProvider record component.
      Returns:
      the value of the sessionProvider record component
    • userExcuseProvider

      @NotNull public @NotNull UserExcuseProvider userExcuseProvider()
      Returns the value of the userExcuseProvider record component.
      Returns:
      the value of the userExcuseProvider record component
    • punishUserProvider

      @NotNull public @NotNull PunishmentUserProvider punishUserProvider()
      Returns the value of the punishUserProvider record component.
      Returns:
      the value of the punishUserProvider record component
    • punishAuditProvider

      @NotNull public @NotNull PunishmentAuditProvider punishAuditProvider()
      Returns the value of the punishAuditProvider record component.
      Returns:
      the value of the punishAuditProvider record component