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;
|
||||
|
||||
/**
|
||||
* A Prompt is the main constituent of a {@link Conversation}. Each prompt
|
||||
* displays text to the user and optionally waits for a user's response.
|
||||
@@ -21,7 +24,8 @@ public interface Prompt extends Cloneable {
|
||||
* @param context Context information about the conversation.
|
||||
* @return The text to display.
|
||||
*/
|
||||
String getPromptText(ConversationContext context);
|
||||
@NotNull
|
||||
String getPromptText(@NotNull ConversationContext context);
|
||||
|
||||
/**
|
||||
* Checks to see if this prompt implementation should wait for user input
|
||||
@@ -29,9 +33,9 @@ public interface Prompt extends Cloneable {
|
||||
*
|
||||
* @param context Context information about the conversation.
|
||||
* @return If true, the {@link Conversation} will wait for input before
|
||||
* continuing.
|
||||
* continuing. If false, {@link #acceptInput(ConversationContext, String)} will be called immediately with {@code null} input.
|
||||
*/
|
||||
boolean blocksForInput(ConversationContext context);
|
||||
boolean blocksForInput(@NotNull ConversationContext context);
|
||||
|
||||
/**
|
||||
* Accepts and processes input from the user. Using the input, the next
|
||||
@@ -41,5 +45,6 @@ public interface Prompt extends Cloneable {
|
||||
* @param input The input text from the user.
|
||||
* @return The next Prompt in the prompt graph.
|
||||
*/
|
||||
Prompt acceptInput(ConversationContext context, String input);
|
||||
@Nullable
|
||||
Prompt acceptInput(@NotNull ConversationContext context, @Nullable String input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user