SPIGOT-2540: Add nullability annotations to entire Bukkit API

By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
Bukkit/Spigot
2019-03-13 17:42:57 +11:00
parent e069a80fd8
commit 416c865476
565 changed files with 5372 additions and 2008 deletions

View File

@@ -1,6 +1,7 @@
package org.bukkit.conversations;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
/**
* An InactivityConversationCanceller will cancel a {@link Conversation} after
@@ -18,23 +19,24 @@ public class InactivityConversationCanceller implements ConversationCanceller {
* @param plugin The owning plugin.
* @param timeoutSeconds The number of seconds of inactivity to wait.
*/
public InactivityConversationCanceller(Plugin plugin, int timeoutSeconds) {
public InactivityConversationCanceller(@NotNull Plugin plugin, int timeoutSeconds) {
this.plugin = plugin;
this.timeoutSeconds = timeoutSeconds;
}
public void setConversation(Conversation conversation) {
public void setConversation(@NotNull Conversation conversation) {
this.conversation = conversation;
startTimer();
}
public boolean cancelBasedOnInput(ConversationContext context, String input) {
public boolean cancelBasedOnInput(@NotNull ConversationContext context, @NotNull String input) {
// Reset the inactivity timer
stopTimer();
startTimer();
return false;
}
@NotNull
public ConversationCanceller clone() {
return new InactivityConversationCanceller(plugin, timeoutSeconds);
}
@@ -72,7 +74,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
*
* @param conversation The conversation being abandoned.
*/
protected void cancelling(Conversation conversation) {
protected void cancelling(@NotNull Conversation conversation) {
}
}