Rename 'message' to 'content'

Use 'p' in Message#toArray(Serializable...)
This commit is contained in:
Fuzzlemann 2017-08-16 17:58:27 +02:00
parent f2ce603f37
commit a060182e49

View File

@ -10,34 +10,34 @@ import java.io.Serializable;
*/ */
public class Message { public class Message {
private final String message; private final String content;
public Message(String message) { public Message(String content) {
this.message = message; this.content = content;
} }
public String parse(Serializable... p) { public String parse(Serializable... p) {
String returnValue = this.message; String returnValue = this.content;
for (int i = 0; i < p.length; i++) { for (int i = 0; i < p.length; i++) {
returnValue = returnValue.replace("REPLACE" + i, p[i].toString()); returnValue = returnValue.replace("REPLACE" + i, p[i].toString());
} }
return returnValue; return returnValue;
} }
@Override public String[] toArray() {
public String toString() { return content.split("\\\\");
return message; }
public String[] toArray(Serializable... p) {
return parse(p).split("\\\\");
} }
public String parse() { public String parse() {
return toString(); return toString();
} }
public String[] toArray() { @Override
return message.split("\\\\"); public String toString() {
} return content;
public String[] toArray(Serializable... p) {
return parse().split("\\\\");
} }
} }