SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.metadata;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,7 +18,7 @@ public interface Metadatable {
|
||||
* @throws IllegalArgumentException If value is null, or the owning plugin
|
||||
* is null
|
||||
*/
|
||||
public void setMetadata(String metadataKey, MetadataValue newMetadataValue);
|
||||
public void setMetadata(@NotNull String metadataKey, @NotNull MetadataValue newMetadataValue);
|
||||
|
||||
/**
|
||||
* Returns a list of previously set metadata values from the implementing
|
||||
@@ -27,7 +28,8 @@ public interface Metadatable {
|
||||
* @return A list of values, one for each plugin that has set the
|
||||
* requested value.
|
||||
*/
|
||||
public List<MetadataValue> getMetadata(String metadataKey);
|
||||
@NotNull
|
||||
public List<MetadataValue> getMetadata(@NotNull String metadataKey);
|
||||
|
||||
/**
|
||||
* Tests to see whether the implementing object contains the given
|
||||
@@ -36,7 +38,7 @@ public interface Metadatable {
|
||||
* @param metadataKey the unique metadata key being queried.
|
||||
* @return the existence of the metadataKey within subject.
|
||||
*/
|
||||
public boolean hasMetadata(String metadataKey);
|
||||
public boolean hasMetadata(@NotNull String metadataKey);
|
||||
|
||||
/**
|
||||
* Removes the given metadata value from the implementing object's
|
||||
@@ -48,5 +50,5 @@ public interface Metadatable {
|
||||
* other values will be left untouched.
|
||||
* @throws IllegalArgumentException If plugin is null
|
||||
*/
|
||||
public void removeMetadata(String metadataKey, Plugin owningPlugin);
|
||||
public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user