diff --git a/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java b/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java index 41c8193..d0136ff 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java @@ -32,32 +32,24 @@ public final class FormatBuilder { /** * Instantiates a new format builder * - * @param stringBuilder
The string builder to use output from
+ *If the input is a list, it will be joined using the default delimiter: ",".
+ * + * @param inputThe input to use as the initial string of this format builder
+ * @throws IllegalStateExceptionIf the string formatter has not been set, and the input is a translatable message
*/ - public FormatBuilder(@NotNull StringBuilder stringBuilder) { - this.toFormat = stringBuilder.toString(); + publicThe translatable message to format
- * @throws IllegalStateExceptionIf the string formatter has not been set
+ * @param inputThe input to use as the initial string of this format builder
+ * @param delimiterThe delimiter used for joining if the input is some kind of list
+ * @throws IllegalStateExceptionIf the string formatter has not been set, and the input is a translatable message
*/ - public FormatBuilder(@NotNull TranslatableMessage translatableMessage) throws IllegalStateException { - if (FormatBuilder.stringFormatter == null) { - throw NOT_SETUP_EXCEPTION; - } - this.toFormat = FormatBuilder.stringFormatter.getUnFormattedMessage(translatableMessage); - } - - /** - * Instantiates a new format builder - * - * @param toFormatThe string to format
- */ - public FormatBuilder(@NotNull String toFormat) { - this.toFormat = toFormat; + publicIf the placeholder or replacement is a list, it will be joined using the default delimiter: ",".
* * @param placeholderThe placeholder to replace
@@ -118,7 +110,7 @@ public final class FormatBuilder { * * @param placeholderThe placeholder to replace
* @param replacementThe replacement
- * @param delimiterThe delimiter used for joining if the replacement is some kind of list
+ * @param delimiterThe delimiter used for joining if the replacement is some kind of list
* @returnThis format builder
* @throws IllegalStateExceptionIf the string formatter has not been set, and the placeholder or replacement is * a translatable message
@@ -126,7 +118,7 @@ public final class FormatBuilder { @NotNull publicIf the input is a list, it will be joined using the default delimiter: ",".
- * + * * @param inputThe input to append
* @returnThis format builder
* @throws IllegalStateExceptionIf the string formatter has not been set, and the input is a translatable message
@@ -193,7 +185,7 @@ public final class FormatBuilder { /** * Appends the given string to this format builder * - * @param inputThe input to append
+ * @param inputThe input to append
* @param delimiterThe delimiter used for joining if the input is some kind of list
* @returnThis format builder
* @throws IllegalStateExceptionIf the string formatter has not been set, and the input is a translatable message
@@ -252,7 +244,7 @@ public final class FormatBuilder { /** * Converts the given input to a string * - * @param inputThe input to convert
+ * @param inputThe input to convert
* @param delimiterThe delimiter to use if the input is some kind of list
* @returnThe corresponding string
* @throws IllegalStateExceptionIf the string formatter has not been set, and the input is a translatable message.