Alright then

This commit is contained in:
Norbi Peti 2017-07-19 22:56:35 +02:00
parent bae49352ef
commit 5e7da1e89a

View file

@ -26,12 +26,12 @@ public class ChatFormatterBuilder implements Serializable {
short removecharcount = 0; short removecharcount = 0;
boolean range = false; boolean range = false;
/**
* The returned object is backed by this builder. All changes made to this object affets the returned one.
*/
@SneakyThrows @SneakyThrows
public ChatFormatter build() { public ChatFormatter build() {
final ByteArrayOutputStream str = new ByteArrayOutputStream(); return new ChatFormatter(this);
new ObjectOutputStream(str).writeObject(this);
return new ChatFormatter(
(ChatFormatterBuilder) new ObjectInputStream(new ByteArrayInputStream(str.toByteArray())).readObject());
} }
public Pattern getRegex() { public Pattern getRegex() {