mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 09:00:28 +08:00
Converted ChatFormatter to an interface
This commit is contained in:
parent
7dce52245f
commit
8004e990d9
@ -22,11 +22,11 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ChatFormatter {
|
||||
public interface ChatFormatter {
|
||||
|
||||
public abstract int getWidth(String part);
|
||||
int getWidth(String part);
|
||||
|
||||
public String table(String message, String separator) {
|
||||
default String table(String message, String separator) {
|
||||
String[] lines = StringUtils.split(message, '\n');
|
||||
List<String[]> rows = new ArrayList<>();
|
||||
Maximum.ForInteger rowWidth = new Maximum.ForInteger(0);
|
||||
@ -54,7 +54,7 @@ public abstract class ChatFormatter {
|
||||
return table.toString();
|
||||
}
|
||||
|
||||
public List<String[]> tableAsParts(String message, String separator) {
|
||||
default List<String[]> tableAsParts(String message, String separator) {
|
||||
String[] lines = StringUtils.split(message, '\n');
|
||||
List<String[]> rows = new ArrayList<>();
|
||||
Maximum.ForInteger rowWidth = new Maximum.ForInteger(0);
|
||||
|
@ -18,7 +18,7 @@ package com.djrapitops.plan.commands.use;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class ConsoleChatFormatter extends ChatFormatter {
|
||||
public class ConsoleChatFormatter implements ChatFormatter {
|
||||
|
||||
@Override
|
||||
public int getWidth(String part) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
package com.djrapitops.plan.commands.use;
|
||||
|
||||
public class PlayerChatFormatter extends ChatFormatter {
|
||||
public class PlayerChatFormatter implements ChatFormatter {
|
||||
|
||||
@Override
|
||||
public int getWidth(String part) {
|
||||
|
Loading…
Reference in New Issue
Block a user