Record Class PunishmentService

java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.punishment.PunishmentService

public record PunishmentService(@NotNull PunishmentReasonProvider reasonProvider, @NotNull PunishmentAuditProvider auditProvider, @NotNull PunishmentIpAddressProvider ipProvider, @NotNull PunishmentUserProvider userProvider) extends Record
  • Constructor Details

    • PunishmentService

      public PunishmentService(@NotNull @NotNull PunishmentReasonProvider reasonProvider, @NotNull @NotNull PunishmentAuditProvider auditProvider, @NotNull @NotNull PunishmentIpAddressProvider ipProvider, @NotNull @NotNull PunishmentUserProvider userProvider)
      Creates an instance of a PunishmentService record class.
      Parameters:
      reasonProvider - the value for the reasonProvider record component
      auditProvider - the value for the auditProvider record component
      ipProvider - the value for the ipProvider record component
      userProvider - the value for the userProvider record component
  • Method Details

    • punishedUser

      public int punishedUser(@NotNull @NotNull UUID mojangId, int reasonId, int executorId)
    • punishedIp

      public int punishedIp(@NotNull @NotNull InetAddress inetAddress, int reasonId, int executorId)
    • unpunishedUser

      public int unpunishedUser(@NotNull @NotNull UUID mojangId, int typeId, @NotNull @NotNull UUID auditId, int executorId)
    • unpunishedIp

      public int unpunishedIp(@NotNull @NotNull InetAddress inetAddress, int typeId, @NotNull @NotNull UUID auditId, int executorId)
    • isPunishedUser

      public boolean isPunishedUser(@NotNull @NotNull UUID mojangId, int typeId)
    • isPunishedIp

      public boolean isPunishedIp(@NotNull @NotNull InetAddress inetAddress, int typeId)
    • isExpiredUser

      public boolean isExpiredUser(@NotNull @NotNull UUID mojangId, int typeId)
    • isExpiredIp

      public boolean isExpiredIp(@NotNull @NotNull InetAddress inetAddress, int typeId)
    • checkUserPunishment

      public boolean checkUserPunishment(@NotNull @NotNull UUID mojangId, int typeId, @NotNull @NotNull Consumer<PunishmentAudit> consumer)
    • checkIpPunishment

      public boolean checkIpPunishment(@NotNull @NotNull InetAddress inetAddress, int typeId, @NotNull @NotNull Consumer<PunishmentAudit> consumer)
    • loadExpired

      public int loadExpired()
    • 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.
    • reasonProvider

      @NotNull public @NotNull PunishmentReasonProvider reasonProvider()
      Returns the value of the reasonProvider record component.
      Returns:
      the value of the reasonProvider record component
    • auditProvider

      @NotNull public @NotNull PunishmentAuditProvider auditProvider()
      Returns the value of the auditProvider record component.
      Returns:
      the value of the auditProvider record component
    • ipProvider

      @NotNull public @NotNull PunishmentIpAddressProvider ipProvider()
      Returns the value of the ipProvider record component.
      Returns:
      the value of the ipProvider record component
    • userProvider

      @NotNull public @NotNull PunishmentUserProvider userProvider()
      Returns the value of the userProvider record component.
      Returns:
      the value of the userProvider record component