Add jsr305 annotations to the API

This commit is contained in:
Luck
2017-06-24 17:25:13 +01:00
Unverified
parent 26ce8b8ab7
commit 2ffbeeef8e
59 changed files with 690 additions and 347 deletions
@@ -29,6 +29,8 @@ import me.lucko.luckperms.api.LuckPermsApi;
import java.util.Optional;
import javax.annotation.Nonnull;
/**
* Singleton for the {@link LuckPermsApi}.
*
@@ -44,6 +46,7 @@ public final class LuckPerms {
* @return an api instance
* @throws IllegalStateException if the api is not loaded
*/
@Nonnull
public static LuckPermsApi getApi() {
if (api == null) {
throw new IllegalStateException("API is not loaded.");
@@ -59,6 +62,7 @@ public final class LuckPerms {
*
* @return an optional api instance
*/
@Nonnull
public static Optional<LuckPermsApi> getApiSafe() {
return Optional.ofNullable(api);
}