Adds missing @NotNull annotations
All checks were successful
EpicKnarvik97/KnarLib/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/KnarLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package net.knarcraft.knarlib.formatting;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -25,7 +27,7 @@ public final class StringReplacer {
|
||||
*
|
||||
* @param replacementInput <p>The input string to replace placeholders for</p>
|
||||
*/
|
||||
public StringReplacer(String replacementInput) {
|
||||
public StringReplacer(@NotNull String replacementInput) {
|
||||
this.replacementInput = replacementInput;
|
||||
}
|
||||
|
||||
@@ -35,7 +37,7 @@ public final class StringReplacer {
|
||||
* @param placeholder <p>The placeholder to replace</p>
|
||||
* @param value <p>The replacement value</p>
|
||||
*/
|
||||
public void add(String placeholder, String value) {
|
||||
public void add(@NotNull String placeholder, @NotNull String value) {
|
||||
this.replacements.put(placeholder, value);
|
||||
}
|
||||
|
||||
@@ -44,7 +46,7 @@ public final class StringReplacer {
|
||||
*
|
||||
* @param placeholder <p>The placeholder to remove</p>
|
||||
*/
|
||||
public void remove(String placeholder) {
|
||||
public void remove(@NotNull String placeholder) {
|
||||
this.replacements.remove(placeholder);
|
||||
}
|
||||
|
||||
@@ -55,7 +57,7 @@ public final class StringReplacer {
|
||||
*
|
||||
* @return <p>The string with placeholders replaced</p>
|
||||
*/
|
||||
public String replace() {
|
||||
public @NotNull String replace() {
|
||||
if (replacementInput == null) {
|
||||
throw new IllegalStateException("This method cannot be run without a defined string");
|
||||
}
|
||||
@@ -68,7 +70,7 @@ public final class StringReplacer {
|
||||
* @param input <p>The string to replace placeholders in</p>
|
||||
* @return <p>The string with placeholders replaced</p>
|
||||
*/
|
||||
public String replace(String input) {
|
||||
public @NotNull String replace(@NotNull String input) {
|
||||
return StringFormatter.replacePlaceholders(input, replacements.keySet().toArray(new String[0]),
|
||||
replacements.values().toArray(new String[0]));
|
||||
}
|
||||
|
Reference in New Issue
Block a user