Klasse HistoryEntry

java.lang.Object
me.kzlyth.api.history.HistoryEntry

public class HistoryEntry extends Object
Represents a history entry (punishment case) retrieved from the database.

This model contains information about a punishment case including target, staff member, punishment type, reason, timestamps, and status.

Example:


 HistoryAPI historyAPI = api.getHistoryAPI();
 HistoryEntry entry = historyAPI.getHistoryByCaseId(123).join();
 if (entry != null) {
     getLogger().info("Case ID: " + entry.getCaseId());
     getLogger().info("Target: " + entry.getTargetName());
     getLogger().info("Type: " + entry.getPunishmentType());
     getLogger().info("Active: " + entry.isActive());
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • HistoryEntry

      public HistoryEntry(int caseId, @NotNull @NotNull UUID targetUuid, @NotNull @NotNull String targetName, @NotNull @NotNull String targetIp, @NotNull @NotNull UUID staffUuid, @NotNull @NotNull String staffName, @NotNull @NotNull String punishmentType, @NotNull @NotNull String reason, long timestamp, long duration, boolean active, @Nullable @Nullable String additionalData)
      Constructs a new HistoryEntry object.
      Parameter:
      caseId - The case ID
      targetUuid - The target player's UUID
      targetName - The target player's name
      targetIp - The target player's IP address
      staffUuid - The staff member's UUID
      staffName - The staff member's name
      punishmentType - The punishment type
      reason - The reason for the punishment
      timestamp - The timestamp when issued
      duration - The duration in milliseconds (-1 for permanent)
      active - Whether the punishment is active
      additionalData - Additional data (JSON string)
  • Methodendetails

    • getCaseId

      public int getCaseId()
      Gets the case ID of this history entry.
      Gibt zurück:
      The case ID
    • getTargetUuid

      @NotNull public @NotNull UUID getTargetUuid()
      Gets the UUID of the target player.
      Gibt zurück:
      The target player's UUID
    • getTargetName

      @NotNull public @NotNull String getTargetName()
      Gets the name of the target player at the time of punishment.
      Gibt zurück:
      The target player's name
    • getTargetIp

      @NotNull public @NotNull String getTargetIp()
      Gets the IP address of the target player at the time of punishment.
      Gibt zurück:
      The target player's IP address
    • getStaffUuid

      @NotNull public @NotNull UUID getStaffUuid()
      Gets the UUID of the staff member who issued the punishment.
      Gibt zurück:
      The staff member's UUID
    • getStaffName

      @NotNull public @NotNull String getStaffName()
      Gets the name of the staff member who issued the punishment.
      Gibt zurück:
      The staff member's name
    • getPunishmentType

      @NotNull public @NotNull String getPunishmentType()
      Gets the type of punishment.
      Gibt zurück:
      The punishment type (e.g., "BAN", "MUTE", "WARN", "KICK")
    • getReason

      @NotNull public @NotNull String getReason()
      Gets the reason for the punishment.
      Gibt zurück:
      The punishment reason
    • getTimestamp

      public long getTimestamp()
      Gets the timestamp when the punishment was issued.
      Gibt zurück:
      Timestamp in milliseconds since epoch
    • getDuration

      public long getDuration()
      Gets the duration of the punishment.
      Gibt zurück:
      Duration in milliseconds, or -1 for permanent
    • isActive

      public boolean isActive()
      Checks if this punishment is currently active.
      Gibt zurück:
      true if the punishment is active, false otherwise
    • getAdditionalData

      @Nullable public @Nullable String getAdditionalData()
      Gets additional data associated with this punishment.
      Gibt zurück:
      Additional data as JSON string, or null if none
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object