Skip to content

Commit

Permalink
Okay, back to allowing custom types
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 25, 2024
1 parent d0cdeb1 commit 1b75a2a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/world/bentobox/bentobox/api/logs/LogEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class LogEntry {
@Expose
private final LogType type;
@Expose
private final String customType;
@Expose
private final Map<String, String> data;

/**
Expand All @@ -45,6 +47,10 @@ public enum LogType {
* Player banned
*/
BAN,
/**
* Something was completed
*/
COMPELTE,
/**
* Island became unowned
*/
Expand Down Expand Up @@ -103,6 +109,7 @@ private LogEntry(@NonNull Builder builder) {
this.timestamp = builder.timestamp;
this.type = builder.type;
this.data = builder.data;
this.customType = builder.customType;
}

public long getTimestamp() {
Expand All @@ -123,22 +130,23 @@ public static class Builder {
private long timestamp;
private final LogType type;
private Map<String, String> data;
private final String customType;

public Builder(LogType type) {
this.timestamp = System.currentTimeMillis();
this.type = type;
this.data = new LinkedHashMap<>();
this.customType = null;
}

/**
* @param string
* @deprecated Use the enum version. If you need more enums, then add them to the code
* @param customType log type
*/
@Deprecated
public Builder(String string) {
public Builder(String customType) {
this.timestamp = System.currentTimeMillis();
this.type = LogType.UNKNOWN;
this.data = new LinkedHashMap<>();
this.customType = customType;
}

public Builder timestamp(long timestamp) {
Expand Down

0 comments on commit 1b75a2a

Please sign in to comment.