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,5 +1,8 @@
package org.bukkit.advancement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Date;
@@ -14,6 +17,7 @@ public interface AdvancementProgress {
*
* @return the relevant advancement
*/
@NotNull
Advancement getAdvancement();
/**
@@ -30,7 +34,7 @@ public interface AdvancementProgress {
* @return true if awarded, false if criteria does not exist or already
* awarded.
*/
boolean awardCriteria(String criteria);
boolean awardCriteria(@NotNull String criteria);
/**
* Mark the specified criteria as uncompleted.
@@ -38,7 +42,7 @@ public interface AdvancementProgress {
* @param criteria the criteria to mark
* @return true if removed, false if criteria does not exist or not awarded
*/
boolean revokeCriteria(String criteria);
boolean revokeCriteria(@NotNull String criteria);
/**
* Get the date the specified criteria was awarded.
@@ -46,13 +50,15 @@ public interface AdvancementProgress {
* @param criteria the criteria to check
* @return date awarded or null if unawarded or criteria does not exist
*/
Date getDateAwarded(String criteria);
@Nullable
Date getDateAwarded(@NotNull String criteria);
/**
* Get the criteria which have not been awarded.
*
* @return unmodifiable copy of criteria remaining
*/
@NotNull
Collection<String> getRemainingCriteria();
/**
@@ -60,5 +66,6 @@ public interface AdvancementProgress {
*
* @return unmodifiable copy of criteria awarded
*/
@NotNull
Collection<String> getAwardedCriteria();
}