Converted ChatFormatter to an interface

This commit is contained in:
Aurora Lahtela 2022-08-31 09:51:05 +03:00
parent 7dce52245f
commit 8004e990d9
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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) {