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

@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import org.bukkit.block.data.BlockData;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull;
public enum Particle {
EXPLOSION_NORMAL,
@@ -70,7 +71,7 @@ public enum Particle {
dataType = Void.class;
}
Particle(Class<?> data) {
Particle(@NotNull Class<?> data) {
dataType = data;
}
@@ -78,6 +79,7 @@ public enum Particle {
* Returns the required data type for the particle
* @return the required data type
*/
@NotNull
public Class<?> getDataType() {
return dataType;
}
@@ -91,7 +93,7 @@ public enum Particle {
private final Color color;
private final float size;
public DustOptions(Color color, float size) {
public DustOptions(@NotNull Color color, float size) {
Preconditions.checkArgument(color != null, "color");
this.color = color;
this.size = size;
@@ -102,6 +104,7 @@ public enum Particle {
*
* @return particle color
*/
@NotNull
public Color getColor() {
return color;
}