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,9 @@
package org.bukkit.boss;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -11,6 +14,7 @@ public interface BossBar {
*
* @return the title of the bar
*/
@NotNull
String getTitle();
/**
@@ -18,13 +22,14 @@ public interface BossBar {
*
* @param title the title of the bar
*/
void setTitle(String title);
void setTitle(@Nullable String title);
/**
* Returns the color of this boss bar
*
* @return the color of the bar
*/
@NotNull
BarColor getColor();
/**
@@ -32,13 +37,14 @@ public interface BossBar {
*
* @param color the color of the bar
*/
void setColor(BarColor color);
void setColor(@NotNull BarColor color);
/**
* Returns the style of this boss bar
*
* @return the style of the bar
*/
@NotNull
BarStyle getStyle();
/**
@@ -46,21 +52,21 @@ public interface BossBar {
*
* @param style the style of the bar
*/
void setStyle(BarStyle style);
void setStyle(@NotNull BarStyle style);
/**
* Remove an existing flag on this boss bar
*
* @param flag the existing flag to remove
*/
void removeFlag(BarFlag flag);
void removeFlag(@NotNull BarFlag flag);
/**
* Add an optional flag to this boss bar
*
* @param flag an optional flag to set on the boss bar
*/
void addFlag(BarFlag flag);
void addFlag(@NotNull BarFlag flag);
/**
* Returns whether this boss bar as the passed flag set
@@ -68,7 +74,7 @@ public interface BossBar {
* @param flag the flag to check
* @return whether it has the flag
*/
boolean hasFlag(BarFlag flag);
boolean hasFlag(@NotNull BarFlag flag);
/**
* Sets the progress of the bar. Values should be between 0.0 (empty) and
@@ -90,7 +96,7 @@ public interface BossBar {
*
* @param player the player to add
*/
void addPlayer(Player player);
void addPlayer(@NotNull Player player);
/**
* Removes the player from this boss bar causing it to be removed from their
@@ -98,7 +104,7 @@ public interface BossBar {
*
* @param player the player to remove
*/
void removePlayer(Player player);
void removePlayer(@NotNull Player player);
/**
* Removes all players from this boss bar
@@ -112,6 +118,7 @@ public interface BossBar {
*
* @return a immutable list of players
*/
@NotNull
List<Player> getPlayers();
/**