mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-26 08:03:02 +00:00
Add some more annotations to mark API methods
This commit is contained in:
45 files changed
+143
-90
No files matched your search
@@ -125,7 +125,7 @@ public class LuckPermsApiProvider implements LuckPerms {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public @NonNull <T> PlayerAdapter<T> getPlayerAdapter(@NonNull Class<T> playerClass) {
|
||||
public <T> @NonNull PlayerAdapter<T> getPlayerAdapter(@NonNull Class<T> playerClass) {
|
||||
Objects.requireNonNull(playerClass, "playerClass");
|
||||
Class<?> expectedClass = this.plugin.getContextManager().getPlayerClass();
|
||||
if (!expectedClass.equals(playerClass)) {
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class ApiGroupManager extends ApiAbstractManager<Group, net.luckperms.api
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public @NonNull <T extends Node> CompletableFuture<Map<String, Collection<T>>> searchAll(@NonNull NodeMatcher<? extends T> matcher) {
|
||||
public <T extends Node> @NonNull CompletableFuture<Map<String, Collection<T>>> searchAll(@NonNull NodeMatcher<? extends T> matcher) {
|
||||
Objects.requireNonNull(matcher, "matcher");
|
||||
ConstraintNodeMatcher<? extends T> constraint = (ConstraintNodeMatcher<? extends T>) matcher;
|
||||
return this.plugin.getStorage().searchGroupNodes(constraint).thenApply(list -> {
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public final class ApiNodeMatcherFactory implements NodeMatcherFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends Node> NodeMatcher<T> key(@NonNull T node) {
|
||||
public <T extends Node> @NonNull NodeMatcher<T> key(@NonNull T node) {
|
||||
return StandardNodeMatchers.key(node);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public final class ApiNodeMatcherFactory implements NodeMatcherFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends Node> NodeMatcher<T> type(NodeType<? extends T> type) {
|
||||
public <T extends Node> @NonNull NodeMatcher<T> type(NodeType<? extends T> type) {
|
||||
Objects.requireNonNull(type, "type");
|
||||
return StandardNodeMatchers.type(type);
|
||||
}
|
||||
|
||||
+2
-2
@@ -123,7 +123,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends Node> Collection<T> getNodes(@NonNull NodeType<T> type) {
|
||||
public <T extends Node> @NonNull Collection<T> getNodes(@NonNull NodeType<T> type) {
|
||||
Objects.requireNonNull(type, "type");
|
||||
return this.handle.getOwnNodes(type, QueryOptionsImpl.DEFAULT_NON_CONTEXTUAL);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class ApiPermissionHolder implements net.luckperms.api.model.PermissionHo
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends Node> Collection<T> resolveInheritedNodes(@NonNull NodeType<T> type, @NonNull QueryOptions queryOptions) {
|
||||
public <T extends Node> @NonNull Collection<T> resolveInheritedNodes(@NonNull NodeType<T> type, @NonNull QueryOptions queryOptions) {
|
||||
Objects.requireNonNull(type, "type");
|
||||
Objects.requireNonNull(queryOptions, "queryOptions");
|
||||
return this.handle.resolveInheritedNodes(type, queryOptions);
|
||||
|
||||
@@ -93,14 +93,14 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends LuckPermsEvent> EventSubscription<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler) {
|
||||
public <T extends LuckPermsEvent> @NonNull EventSubscription<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler) {
|
||||
Objects.requireNonNull(eventClass, "eventClass");
|
||||
Objects.requireNonNull(handler, "handler");
|
||||
return registerSubscription(eventClass, handler, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends LuckPermsEvent> EventSubscription<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler) {
|
||||
public <T extends LuckPermsEvent> @NonNull EventSubscription<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler) {
|
||||
Objects.requireNonNull(plugin, "plugin");
|
||||
Objects.requireNonNull(eventClass, "eventClass");
|
||||
Objects.requireNonNull(handler, "handler");
|
||||
@@ -122,7 +122,7 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T extends LuckPermsEvent> Set<EventSubscription<T>> getSubscriptions(@NonNull Class<T> eventClass) {
|
||||
public <T extends LuckPermsEvent> @NonNull Set<EventSubscription<T>> getSubscriptions(@NonNull Class<T> eventClass) {
|
||||
return this.bus.getHandlers(eventClass);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public abstract class AbstractNodeBuilder<N extends ScopedNode<N, B>, B extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <T> B withMetadata(@NonNull NodeMetadataKey<T> key, @Nullable T metadata) {
|
||||
public <T> @NonNull B withMetadata(@NonNull NodeMetadataKey<T> key, @Nullable T metadata) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
if (metadata == null) {
|
||||
this.metadata.remove(key);
|
||||
|
||||
@@ -101,7 +101,7 @@ public class QueryOptionsImpl implements QueryOptions {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull <O> Optional<O> option(@NonNull OptionKey<O> key) {
|
||||
public <O> @NonNull Optional<O> option(@NonNull OptionKey<O> key) {
|
||||
if (this.options == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user