Interface PunishmentIP

All Known Implementing Classes:
PunishmentIPProvider

public sealed interface PunishmentIP permits PunishmentIPProvider
Represents an IP address that has been punished or is subject to a punishment.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    exists(InetAddress inetAddress, int typeId)
    Checks if a punishment record exists for the given type ID and IP address.
    getCreatedAt(InetAddress inetAddress, int typeId)
    Retrieves the timestamp indicating when the specified punishment record was created.
    int
    getCreatedBy(InetAddress inetAddress, int typeId)
    Retrieves the identifier of the user who created a punishment for the specified type and IP address.
    long
    getDuration(InetAddress inetAddress, int typeId)
    Retrieves the duration associated with a specific type and IP address.
    getExpiredDate(InetAddress inetAddress, int typeId)
    Retrieves the expiration date as a string for a specific punishment type and IP address.
    long
    getExpiredTime(InetAddress inetAddress, int typeId)
    Retrieves the expiration time of the punishment for the specified type and IP address.
    getIps(int typeId)
    Retrieves a list of IP addresses associated with the specified type.
    getLogId(InetAddress inetAddress, int typeId)
    Retrieves the log identifier associated with the specified type ID and IP address.
    getModifiedAt(InetAddress inetAddress, int typeId)
    Retrieves the timestamp when the specified punishment was last modified.
    int
    getModifiedBy(InetAddress inetAddress, int typeId)
    Retrieves the ID of the entity or executor that last modified the punishment record based on the provided punishment type ID and IP address.
    getReason(InetAddress inetAddress, int typeId)
    Retrieves the reason associated with a specific punishment type and IP address.
    int
    getReasonId(InetAddress inetAddress, int typeId)
    Retrieves the reason identifier associated with a specific type and IP address.
    boolean
    isPunished(InetAddress inetAddress, int typeId)
    Checks if a specific IP address is currently punished for a given type.
    void
    punish(InetAddress inetAddress, int typeId, int executorId, int reasonId)
    Applies a punishment for a given IP address with specific type and reason.
    void
    setExpiredTime(InetAddress inetAddress, int typeId, int executorId, long time)
    Sets the expiration time for a specific punishment on an IP address.
    void
    setReasonId(InetAddress inetAddress, int typeId, int executorId, int reasonId)
    Updates the reason ID for an existing punishment associated with the specified type, IP address, and executor.
    void
    unpunished(InetAddress inetAddress, int typeId)
    Removes the punishment associated with the given type and IP address.
  • Method Details

    • exists

      boolean exists(InetAddress inetAddress, int typeId)
      Checks if a punishment record exists for the given type ID and IP address.
      Parameters:
      inetAddress - The IP address to check for existence of a punishment
      typeId - The ID representing the type of punishment
      Returns:
      true if a punishment record exists for the specified type ID and IP address, false otherwise
    • punish

      void punish(InetAddress inetAddress, int typeId, int executorId, int reasonId)
      Applies a punishment for a given IP address with specific type and reason.
      Parameters:
      inetAddress - The IP address to which the punishment will be applied
      typeId - The type identifier of the punishment
      executorId - The identifier of the executor applying the punishment
      reasonId - The identifier of the reason for the punishment
    • unpunished

      void unpunished(InetAddress inetAddress, int typeId)
      Removes the punishment associated with the given type and IP address.
      Parameters:
      inetAddress - The IP address for which the punishment is removed
      typeId - The identifier of the punishment type to remove
    • getIps

      List<String> getIps(int typeId)
      Retrieves a list of IP addresses associated with the specified type.
      Parameters:
      typeId - The identifier for the type of punishment or record for which the IPs are to be retrieved
      Returns:
      A list of IP addresses corresponding to the specified type
    • getLogId

      UUID getLogId(InetAddress inetAddress, int typeId)
      Retrieves the log identifier associated with the specified type ID and IP address.
      Parameters:
      inetAddress - The IP address for which the log ID is being queried
      typeId - An integer representing the type identifier for the punishment or operation
      Returns:
      A UUID representing the log identifier, or null if no log is associated with the given parameters
    • getReasonId

      int getReasonId(InetAddress inetAddress, int typeId)
      Retrieves the reason identifier associated with a specific type and IP address.
      Parameters:
      inetAddress - The IP address for which the reason identifier is being requested.
      typeId - The identifier representing the punishment type.
      Returns:
      The reason identifier associated with the specified type and IP address.
    • setReasonId

      void setReasonId(InetAddress inetAddress, int typeId, int executorId, int reasonId)
      Updates the reason ID for an existing punishment associated with the specified type, IP address, and executor.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The type identifier for the punishment
      executorId - The identifier of the executor making the change
      reasonId - The new reason identifier to be set
    • getReason

      String getReason(InetAddress inetAddress, int typeId)
      Retrieves the reason associated with a specific punishment type and IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The identifier for the punishment type
      Returns:
      The reason for the punishment as a String
    • getDuration

      long getDuration(InetAddress inetAddress, int typeId)
      Retrieves the duration associated with a specific type and IP address.
      Parameters:
      inetAddress - The IP address associated with the entity
      typeId - The identifier of the type for which the duration is being retrieved
      Returns:
      The duration in milliseconds
    • getExpiredTime

      long getExpiredTime(InetAddress inetAddress, int typeId)
      Retrieves the expiration time of the punishment for the specified type and IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The identification number of the punishment type
      Returns:
      The expiration time of the punishment in milliseconds since epoch
    • getExpiredDate

      String getExpiredDate(InetAddress inetAddress, int typeId)
      Retrieves the expiration date as a string for a specific punishment type and IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The identifier of the punishment type
      Returns:
      The expiration date as a string, or null if no expiration date is set
    • setExpiredTime

      void setExpiredTime(InetAddress inetAddress, int typeId, int executorId, long time)
      Sets the expiration time for a specific punishment on an IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment.
      typeId - The type identifier of the punishment.
      executorId - The ID of the executor making this change.
      time - The new expiration time for the punishment in milliseconds since epoch.
    • isPunished

      boolean isPunished(InetAddress inetAddress, int typeId)
      Checks if a specific IP address is currently punished for a given type.
      Parameters:
      inetAddress - The IP address to check
      typeId - The unique identifier of the type of punishment
      Returns:
      true if the IP address is punished for the specified type, false otherwise
    • getCreatedBy

      int getCreatedBy(InetAddress inetAddress, int typeId)
      Retrieves the identifier of the user who created a punishment for the specified type and IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The type identifier associated with the punishment
      Returns:
      The identifier of the creator of the punishment
    • getCreatedAt

      Timestamp getCreatedAt(InetAddress inetAddress, int typeId)
      Retrieves the timestamp indicating when the specified punishment record was created.
      Parameters:
      inetAddress - The IP address associated with the punishment record
      typeId - The unique identifier of the punishment type
      Returns:
      The timestamp of the creation time for the punishment record
    • getModifiedBy

      int getModifiedBy(InetAddress inetAddress, int typeId)
      Retrieves the ID of the entity or executor that last modified the punishment record based on the provided punishment type ID and IP address.
      Parameters:
      inetAddress - The IP address associated with the punishment.
      typeId - The type identifier of the punishment.
      Returns:
      The identifier of the entity or executor who last modified the punishment record.
    • getModifiedAt

      Timestamp getModifiedAt(InetAddress inetAddress, int typeId)
      Retrieves the timestamp when the specified punishment was last modified.
      Parameters:
      inetAddress - The IP address associated with the punishment
      typeId - The identifier of the punishment type
      Returns:
      The timestamp indicating the last modification time of the punishment