SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package org.bukkit.conversations;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
@@ -10,11 +13,11 @@ public abstract class RegexPrompt extends ValidatingPrompt {
|
||||
|
||||
private Pattern pattern;
|
||||
|
||||
public RegexPrompt(String regex) {
|
||||
public RegexPrompt(@NotNull String regex) {
|
||||
this(Pattern.compile(regex));
|
||||
}
|
||||
|
||||
public RegexPrompt(Pattern pattern) {
|
||||
public RegexPrompt(@NotNull Pattern pattern) {
|
||||
super();
|
||||
this.pattern = pattern;
|
||||
}
|
||||
@@ -22,7 +25,7 @@ public abstract class RegexPrompt extends ValidatingPrompt {
|
||||
private RegexPrompt() {}
|
||||
|
||||
@Override
|
||||
protected boolean isInputValid(ConversationContext context, String input) {
|
||||
protected boolean isInputValid(@NotNull ConversationContext context, @NotNull String input) {
|
||||
return pattern.matcher(input).matches();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user