Added toString of online state.

This commit is contained in:
WickedJack99
2024-04-22 21:57:32 +02:00
parent 6fff16a8ba
commit 8f7d0afef4

View File

@@ -17,4 +17,21 @@ public record Peer(String ipAddress, int port, Map<String, String> filesMap, EOn
public boolean equals(Peer other) {
return this.ipAddress.equals(other.ipAddress) && (this.port == other.port);
}
public String onlineStateToString() {
switch (onlineState) {
case Online: {
return "online";
}
case Offline: {
return "offline";
}
case Unknown: {
return "unknown";
}
default: {
return "undefined";
}
}
}
}