Package me.kzlyth.api.history
Klasse HistoryEntry
java.lang.Object
me.kzlyth.api.history.HistoryEntry
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
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungHistoryEntry(int caseId, @NotNull UUID targetUuid, @NotNull String targetName, @NotNull String targetIp, @NotNull UUID staffUuid, @NotNull String staffName, @NotNull String punishmentType, @NotNull String reason, long timestamp, long duration, boolean active, @Nullable String additionalData) Constructs a new HistoryEntry object. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@Nullable StringGets additional data associated with this punishment.intGets the case ID of this history entry.longGets the duration of the punishment.@NotNull StringGets the type of punishment.@NotNull StringGets the reason for the punishment.@NotNull StringGets the name of the staff member who issued the punishment.@NotNull UUIDGets the UUID of the staff member who issued the punishment.@NotNull StringGets the IP address of the target player at the time of punishment.@NotNull StringGets the name of the target player at the time of punishment.@NotNull UUIDGets the UUID of the target player.longGets the timestamp when the punishment was issued.booleanisActive()Checks if this punishment is currently active.toString()
-
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 IDtargetUuid- The target player's UUIDtargetName- The target player's nametargetIp- The target player's IP addressstaffUuid- The staff member's UUIDstaffName- The staff member's namepunishmentType- The punishment typereason- The reason for the punishmenttimestamp- The timestamp when issuedduration- The duration in milliseconds (-1 for permanent)active- Whether the punishment is activeadditionalData- Additional data (JSON string)
-
-
Methodendetails
-
getCaseId
public int getCaseId()Gets the case ID of this history entry.- Gibt zurück:
- The case ID
-
getTargetUuid
Gets the UUID of the target player.- Gibt zurück:
- The target player's UUID
-
getTargetName
Gets the name of the target player at the time of punishment.- Gibt zurück:
- The target player's name
-
getTargetIp
Gets the IP address of the target player at the time of punishment.- Gibt zurück:
- The target player's IP address
-
getStaffUuid
Gets the UUID of the staff member who issued the punishment.- Gibt zurück:
- The staff member's UUID
-
getStaffName
Gets the name of the staff member who issued the punishment.- Gibt zurück:
- The staff member's name
-
getPunishmentType
Gets the type of punishment.- Gibt zurück:
- The punishment type (e.g., "BAN", "MUTE", "WARN", "KICK")
-
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:
trueif the punishment is active,falseotherwise
-
getAdditionalData
Gets additional data associated with this punishment.- Gibt zurück:
- Additional data as JSON string, or
nullif none
-
toString
-