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 Summary
ConstructorsConstructorDescriptionPunishmentService(@NotNull PunishmentReasonProvider reasonProvider, @NotNull PunishmentAuditProvider auditProvider, @NotNull PunishmentIpAddressProvider ipProvider, @NotNull PunishmentUserProvider userProvider) Creates an instance of aPunishmentServicerecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull PunishmentAuditProviderReturns the value of theauditProviderrecord component.booleancheckIpPunishment(@NotNull InetAddress inetAddress, int typeId, @NotNull Consumer<PunishmentAudit> consumer) booleancheckUserPunishment(@NotNull UUID mojangId, int typeId, @NotNull Consumer<PunishmentAudit> consumer) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull PunishmentIpAddressProviderReturns the value of theipProviderrecord component.booleanisExpiredIp(@NotNull InetAddress inetAddress, int typeId) booleanisExpiredUser(@NotNull UUID mojangId, int typeId) booleanisPunishedIp(@NotNull InetAddress inetAddress, int typeId) booleanisPunishedUser(@NotNull UUID mojangId, int typeId) intintpunishedIp(@NotNull InetAddress inetAddress, int reasonId, int executorId) intpunishedUser(@NotNull UUID mojangId, int reasonId, int executorId) @NotNull PunishmentReasonProviderReturns the value of thereasonProviderrecord component.final StringtoString()Returns a string representation of this record class.intunpunishedIp(@NotNull InetAddress inetAddress, int typeId, @NotNull UUID auditId, int executorId) intunpunishedUser(@NotNull UUID mojangId, int typeId, @NotNull UUID auditId, int executorId) @NotNull PunishmentUserProviderReturns the value of theuserProviderrecord component.
-
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 aPunishmentServicerecord class.- Parameters:
reasonProvider- the value for thereasonProviderrecord componentauditProvider- the value for theauditProviderrecord componentipProvider- the value for theipProviderrecord componentuserProvider- the value for theuserProviderrecord component
-
-
Method Details
-
punishedUser
-
punishedIp
-
unpunishedUser
-
unpunishedIp
public int unpunishedIp(@NotNull @NotNull InetAddress inetAddress, int typeId, @NotNull @NotNull UUID auditId, int executorId) -
isPunishedUser
-
isPunishedIp
-
isExpiredUser
-
isExpiredIp
-
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
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). -
reasonProvider
Returns the value of thereasonProviderrecord component.- Returns:
- the value of the
reasonProviderrecord component
-
auditProvider
Returns the value of theauditProviderrecord component.- Returns:
- the value of the
auditProviderrecord component
-
ipProvider
Returns the value of theipProviderrecord component.- Returns:
- the value of the
ipProviderrecord component
-
userProvider
Returns the value of theuserProviderrecord component.- Returns:
- the value of the
userProviderrecord component
-