feat: toString() for data classes and some other more
This commit is contained in:
@@ -1 +1 @@
|
||||
1218
|
||||
1219
|
||||
@@ -300,6 +300,16 @@ public class Bot {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Bot{" +
|
||||
"host='" + host + '\'' +
|
||||
", port=" + port +
|
||||
", username='" + username + '\'' +
|
||||
", loggedIn=" + loggedIn +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static class Listener extends SessionAdapter {
|
||||
public void connecting () {}
|
||||
public void loadedPlugins () {}
|
||||
|
||||
@@ -2,6 +2,8 @@ package me.chayapak1.chomens_bot.command;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public abstract class Command {
|
||||
public final String name;
|
||||
public String description;
|
||||
@@ -27,4 +29,16 @@ public abstract class Command {
|
||||
}
|
||||
|
||||
public abstract Component execute (CommandContext context) throws Exception;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Command{" +
|
||||
"name='" + name + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", usages=" + Arrays.toString(usages) +
|
||||
", aliases=" + Arrays.toString(aliases) +
|
||||
", trustLevel=" + trustLevel +
|
||||
", consoleOnly=" + consoleOnly +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,5 +27,15 @@ public class BossBar {
|
||||
this.division = division;
|
||||
this.health = health;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BossBar{" +
|
||||
"uuid=" + uuid +
|
||||
", title=" + title +
|
||||
", color=" + color +
|
||||
", division=" + division +
|
||||
", health=" + health +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,13 @@ public class FilteredPlayer {
|
||||
this.regex = regex;
|
||||
this.ignoreCase = ignoreCase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FilteredPlayer{" +
|
||||
"playerName='" + playerName + '\'' +
|
||||
", regex=" + regex +
|
||||
", ignoreCase=" + ignoreCase +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package me.chayapak1.chomens_bot.data;
|
||||
|
||||
// https://gist.github.com/kaecy/286f8ad334aec3fcb588516feb727772#file-message-java
|
||||
public class IRCMessage {
|
||||
public String origin;
|
||||
public String nickName;
|
||||
public String command;
|
||||
public String channel;
|
||||
public String content;
|
||||
}
|
||||
@@ -24,4 +24,14 @@ public class Mail {
|
||||
this.server = server;
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Mail{" +
|
||||
"sentBy='" + sentBy + '\'' +
|
||||
", sentTo='" + sentTo + '\'' +
|
||||
", timeSent=" + timeSent +
|
||||
", server='" + server + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,17 @@ public class PlayerEntry {
|
||||
this.listed = listed;
|
||||
}
|
||||
|
||||
public PlayerEntry(PlayerListEntry entry) {
|
||||
public PlayerEntry (PlayerListEntry entry) {
|
||||
this(entry.getProfile(), entry.getGameMode(), entry.getLatency(), entry.getDisplayName(), entry.getExpiresAt(), entry.getPublicKey(), entry.getKeySignature(), entry.isListed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PlayerEntry{" +
|
||||
"gamemode=" + gamemode +
|
||||
", latency=" + latency +
|
||||
", listed=" + listed +
|
||||
", displayName=" + displayName +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,4 +72,20 @@ public class Team {
|
||||
case RESET -> Style.empty();
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Team{" +
|
||||
"teamName='" + teamName + '\'' +
|
||||
", players=" + players +
|
||||
", displayName=" + displayName +
|
||||
", friendlyFire=" + friendlyFire +
|
||||
", seeFriendlyInvisibles=" + seeFriendlyInvisibles +
|
||||
", nametagVisibility=" + nametagVisibility +
|
||||
", collisionRule=" + collisionRule +
|
||||
", color=" + color +
|
||||
", prefix=" + prefix +
|
||||
", suffix=" + suffix +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,13 @@ public class PlayerMessage {
|
||||
this.displayName = displayName;
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PlayerMessage{" +
|
||||
"sender=" + sender +
|
||||
", displayName=" + displayName +
|
||||
", contents=" + contents +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user