From 75f0f40d700552ba9770912515574bd315c36b60 Mon Sep 17 00:00:00 2001
From: Luck
Date: Wed, 19 Sep 2018 21:12:54 +0100
Subject: [PATCH] NonNull annotations should be on the same line in interfaces
---
.../me/lucko/luckperms/api/ActionLogger.java | 12 +-
.../lucko/luckperms/api/DemotionResult.java | 9 +-
.../java/me/lucko/luckperms/api/Entity.java | 9 +-
.../java/me/lucko/luckperms/api/Group.java | 15 +--
.../lucko/luckperms/api/HeldPermission.java | 15 +--
.../lucko/luckperms/api/LPConfiguration.java | 15 +--
.../me/lucko/luckperms/api/LocalizedNode.java | 6 +-
.../main/java/me/lucko/luckperms/api/Log.java | 15 +--
.../java/me/lucko/luckperms/api/LogEntry.java | 66 ++++-------
.../me/lucko/luckperms/api/LuckPermsApi.java | 44 +++----
.../java/me/lucko/luckperms/api/Node.java | 112 +++++++-----------
.../me/lucko/luckperms/api/NodeFactory.java | 6 +-
.../lucko/luckperms/api/PermissionHolder.java | 108 ++++++-----------
.../lucko/luckperms/api/PlayerSaveResult.java | 9 +-
.../lucko/luckperms/api/PromotionResult.java | 9 +-
.../java/me/lucko/luckperms/api/Storage.java | 72 ++++-------
.../api/TemporaryDataMutateResult.java | 6 +-
.../java/me/lucko/luckperms/api/Track.java | 38 +++---
.../java/me/lucko/luckperms/api/User.java | 23 ++--
.../me/lucko/luckperms/api/UuidCache.java | 8 +-
.../luckperms/api/caching/CachedData.java | 39 +++---
.../api/caching/CachedDataContainer.java | 3 +-
.../luckperms/api/caching/MetaContexts.java | 4 +-
.../lucko/luckperms/api/caching/MetaData.java | 27 ++---
.../luckperms/api/caching/PermissionData.java | 6 +-
.../api/context/ContextCalculator.java | 3 +-
.../luckperms/api/context/ContextManager.java | 32 ++---
.../luckperms/api/context/ContextSet.java | 25 ++--
.../api/context/StaticContextCalculator.java | 5 +-
.../luckperms/api/event/Cancellable.java | 4 +-
.../lucko/luckperms/api/event/EventBus.java | 9 +-
.../luckperms/api/event/EventHandler.java | 6 +-
.../luckperms/api/event/LuckPermsEvent.java | 3 +-
.../me/lucko/luckperms/api/event/Sourced.java | 4 +-
.../api/event/group/GroupCacheLoadEvent.java | 8 +-
.../api/event/group/GroupCreateEvent.java | 8 +-
.../group/GroupDataRecalculateEvent.java | 8 +-
.../api/event/group/GroupDeleteEvent.java | 12 +-
.../api/event/group/GroupLoadEvent.java | 4 +-
.../api/event/log/LogBroadcastEvent.java | 8 +-
.../api/event/log/LogNetworkPublishEvent.java | 8 +-
.../api/event/log/LogNotifyEvent.java | 12 +-
.../api/event/log/LogPublishEvent.java | 4 +-
.../api/event/log/LogReceiveEvent.java | 8 +-
.../api/event/node/NodeAddEvent.java | 4 +-
.../api/event/node/NodeMutateEvent.java | 12 +-
.../api/event/node/NodeRemoveEvent.java | 4 +-
.../api/event/player/PlayerDataSaveEvent.java | 12 +-
.../api/event/source/EntitySource.java | 3 +-
.../luckperms/api/event/source/Source.java | 3 +-
.../api/event/sync/PreNetworkSyncEvent.java | 4 +-
.../api/event/track/TrackCreateEvent.java | 8 +-
.../api/event/track/TrackDeleteEvent.java | 12 +-
.../api/event/track/TrackLoadEvent.java | 4 +-
.../track/mutate/TrackAddGroupEvent.java | 4 +-
.../event/track/mutate/TrackMutateEvent.java | 12 +-
.../track/mutate/TrackRemoveGroupEvent.java | 4 +-
.../api/event/user/UserCacheLoadEvent.java | 8 +-
.../event/user/UserDataRecalculateEvent.java | 8 +-
.../api/event/user/UserFirstLoginEvent.java | 8 +-
.../api/event/user/UserLoadEvent.java | 4 +-
.../api/event/user/UserLoginProcessEvent.java | 12 +-
.../api/event/user/track/UserTrackEvent.java | 19 +--
.../luckperms/api/manager/GroupManager.java | 25 ++--
.../luckperms/api/manager/TrackManager.java | 22 ++--
.../luckperms/api/manager/UserManager.java | 32 ++---
.../api/messenger/MessengerProvider.java | 8 +-
.../api/messenger/message/Message.java | 3 +-
.../messenger/message/OutgoingMessage.java | 3 +-
.../messenger/message/type/LogMessage.java | 3 +-
.../message/type/UserUpdateMessage.java | 3 +-
.../api/metastacking/MetaStackDefinition.java | 12 +-
.../api/metastacking/MetaStackElement.java | 4 +-
.../api/metastacking/MetaStackFactory.java | 15 +--
.../api/nodetype/types/DisplayNameType.java | 6 +-
.../api/nodetype/types/InheritanceType.java | 6 +-
.../api/nodetype/types/MetaType.java | 9 +-
.../api/nodetype/types/PrefixType.java | 6 +-
.../api/nodetype/types/RegexType.java | 9 +-
.../api/nodetype/types/SuffixType.java | 6 +-
.../api/nodetype/types/WeightType.java | 3 +-
.../luckperms/api/platform/PlatformInfo.java | 9 +-
.../luckperms/api/platform/PlatformType.java | 6 +-
.../service/model/LPSubjectReference.java | 3 +-
84 files changed, 404 insertions(+), 781 deletions(-)
diff --git a/api/src/main/java/me/lucko/luckperms/api/ActionLogger.java b/api/src/main/java/me/lucko/luckperms/api/ActionLogger.java
index 393a92e8..fe4aa845 100644
--- a/api/src/main/java/me/lucko/luckperms/api/ActionLogger.java
+++ b/api/src/main/java/me/lucko/luckperms/api/ActionLogger.java
@@ -49,8 +49,7 @@ public interface ActionLogger {
* @return a log instance
* @see Storage#getLog()
*/
- @NonNull
- CompletableFuture getLog();
+ @NonNull CompletableFuture getLog();
/**
* Submits a log entry to the plugin to be handled.
@@ -68,8 +67,7 @@ public interface ActionLogger {
* @param entry the entry to submit
* @return a future which will complete when the action is done
*/
- @NonNull
- CompletableFuture submit(@NonNull LogEntry entry);
+ @NonNull CompletableFuture submit(@NonNull LogEntry entry);
/**
* Submits a log entry to the plugins storage handler.
@@ -79,8 +77,7 @@ public interface ActionLogger {
* @param entry the entry to submit
* @return a future which will complete when the action is done
*/
- @NonNull
- CompletableFuture submitToStorage(@NonNull LogEntry entry);
+ @NonNull CompletableFuture submitToStorage(@NonNull LogEntry entry);
/**
* Submits a log entry to the plugins log broadcasting handler.
@@ -91,7 +88,6 @@ public interface ActionLogger {
* @param entry the entry to submit
* @return a future which will complete when the action is done
*/
- @NonNull
- CompletableFuture broadcastAction(@NonNull LogEntry entry);
+ @NonNull CompletableFuture broadcastAction(@NonNull LogEntry entry);
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/DemotionResult.java b/api/src/main/java/me/lucko/luckperms/api/DemotionResult.java
index 22fa319c..8bbf70b5 100644
--- a/api/src/main/java/me/lucko/luckperms/api/DemotionResult.java
+++ b/api/src/main/java/me/lucko/luckperms/api/DemotionResult.java
@@ -41,8 +41,7 @@ public interface DemotionResult extends MutateResult {
*
* @return the status
*/
- @NonNull
- Status getStatus();
+ @NonNull Status getStatus();
@Override
default boolean wasSuccess() {
@@ -60,8 +59,7 @@ public interface DemotionResult extends MutateResult {
*
* @return the group the user was demoted from.
*/
- @NonNull
- Optional getGroupFrom();
+ @NonNull Optional getGroupFrom();
/**
* Gets the name of the group the user was demoted from, if applicable.
@@ -71,8 +69,7 @@ public interface DemotionResult extends MutateResult {
*
* @return the group the user was demoted to.
*/
- @NonNull
- Optional getGroupTo();
+ @NonNull Optional getGroupTo();
/**
* The result status
diff --git a/api/src/main/java/me/lucko/luckperms/api/Entity.java b/api/src/main/java/me/lucko/luckperms/api/Entity.java
index 5b8833cd..b0816def 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Entity.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Entity.java
@@ -49,24 +49,21 @@ public interface Entity {
*
* @return the uuid of the object, if available
*/
- @Nullable
- UUID getUniqueId();
+ @Nullable UUID getUniqueId();
/**
* Gets the name of the object
*
* @return the object name
*/
- @NonNull
- String getName();
+ @NonNull String getName();
/**
* Gets the entities type.
*
* @return the type
*/
- @NonNull
- Type getType();
+ @NonNull Type getType();
/**
* The different types of {@link Entity}
diff --git a/api/src/main/java/me/lucko/luckperms/api/Group.java b/api/src/main/java/me/lucko/luckperms/api/Group.java
index 0a3e7778..b9167c29 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Group.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Group.java
@@ -43,8 +43,7 @@ public interface Group extends PermissionHolder {
*
* @return the name of the group
*/
- @NonNull
- String getName();
+ @NonNull String getName();
/**
* Gets the groups "display name", if it has one that differs from it's actual name.
@@ -57,8 +56,7 @@ public interface Group extends PermissionHolder {
* @return the display name
* @since 4.3
*/
- @Nullable
- String getDisplayName();
+ @Nullable String getDisplayName();
/**
* Gets the groups "display name", if it has one that differs from it's actual name.
@@ -70,8 +68,7 @@ public interface Group extends PermissionHolder {
* @return the display name
* @since 4.3
*/
- @Nullable
- String getDisplayName(@NonNull ContextSet contextSet);
+ @Nullable String getDisplayName(@NonNull ContextSet contextSet);
/**
* Gets the weight of this group, if present.
@@ -79,8 +76,7 @@ public interface Group extends PermissionHolder {
* @return the group weight
* @since 2.17
*/
- @NonNull
- OptionalInt getWeight();
+ @NonNull OptionalInt getWeight();
/**
* Gets the groups's {@link GroupData} cache.
@@ -88,8 +84,7 @@ public interface Group extends PermissionHolder {
* @return the groups cached data.
* @since 4.0
*/
- @NonNull
@Override
- GroupData getCachedData();
+ @NonNull GroupData getCachedData();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/HeldPermission.java b/api/src/main/java/me/lucko/luckperms/api/HeldPermission.java
index 37e5396f..618e8d15 100644
--- a/api/src/main/java/me/lucko/luckperms/api/HeldPermission.java
+++ b/api/src/main/java/me/lucko/luckperms/api/HeldPermission.java
@@ -45,16 +45,14 @@ public interface HeldPermission {
*
* @return the holder
*/
- @NonNull
- T getHolder();
+ @NonNull T getHolder();
/**
* Gets the permission being held
*
* @return the permission
*/
- @NonNull
- String getPermission();
+ @NonNull String getPermission();
/**
* Gets the value of the permission
@@ -68,16 +66,14 @@ public interface HeldPermission {
*
* @return the server
*/
- @NonNull
- Optional getServer();
+ @NonNull Optional getServer();
/**
* Gets the world where the permission is held
*
* @return the world
*/
- @NonNull
- Optional getWorld();
+ @NonNull Optional getWorld();
/**
* Gets the time in unix time when the permission will expire
@@ -98,7 +94,6 @@ public interface HeldPermission {
*
* @return a Node copy of this permission
*/
- @NonNull
- Node asNode();
+ @NonNull Node asNode();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/LPConfiguration.java b/api/src/main/java/me/lucko/luckperms/api/LPConfiguration.java
index 5c1a1c66..124efcc7 100644
--- a/api/src/main/java/me/lucko/luckperms/api/LPConfiguration.java
+++ b/api/src/main/java/me/lucko/luckperms/api/LPConfiguration.java
@@ -39,8 +39,7 @@ public interface LPConfiguration {
*
* @return the name of this server
*/
- @NonNull
- String getServer();
+ @NonNull String getServer();
/**
* Gets if the users on this server will have their global permissions applied
@@ -78,8 +77,7 @@ public interface LPConfiguration {
*
* @return the storage method string from the configuration
*/
- @NonNull
- String getStorageMethod();
+ @NonNull String getStorageMethod();
/**
* Gets true if split storage is enabled
@@ -96,11 +94,9 @@ public interface LPConfiguration {
* method. For example: key = user, value = json
* @since 2.7
*/
- @NonNull
- Map getSplitStorageOptions();
+ @NonNull Map getSplitStorageOptions();
- @NonNull
- Unsafe unsafe();
+ @NonNull Unsafe unsafe();
interface Unsafe {
@@ -115,8 +111,7 @@ public interface LPConfiguration {
* @return the corresponding object, if one is present
* @throws IllegalArgumentException if the key isn't known
*/
- @NonNull
- Object getObject(String key);
+ @NonNull Object getObject(String key);
}
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/LocalizedNode.java b/api/src/main/java/me/lucko/luckperms/api/LocalizedNode.java
index 5f54470b..e9bf05c1 100644
--- a/api/src/main/java/me/lucko/luckperms/api/LocalizedNode.java
+++ b/api/src/main/java/me/lucko/luckperms/api/LocalizedNode.java
@@ -42,8 +42,7 @@ public interface LocalizedNode extends Node {
*
* @return the node this instance is representing
*/
- @NonNull
- Node getNode();
+ @NonNull Node getNode();
/**
* Gets the location where the {@link Node} is inherited from.
@@ -56,7 +55,6 @@ public interface LocalizedNode extends Node {
*
* @return where the node was inherited from.
*/
- @NonNull
- String getLocation();
+ @NonNull String getLocation();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/Log.java b/api/src/main/java/me/lucko/luckperms/api/Log.java
index d4732adc..3171f006 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Log.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Log.java
@@ -47,8 +47,7 @@ public interface Log {
*
* @return the content
*/
- @NonNull
- SortedSet getContent();
+ @NonNull SortedSet getContent();
/**
* Gets the entries in the log performed by the given actor.
@@ -56,8 +55,7 @@ public interface Log {
* @param actor the uuid of the actor to filter by
* @return the content for the given actor
*/
- @NonNull
- SortedSet getContent(@NonNull UUID actor);
+ @NonNull SortedSet getContent(@NonNull UUID actor);
/**
* Gets the log content for a given user
@@ -65,8 +63,7 @@ public interface Log {
* @param uuid the uuid to filter by
* @return all content in this log where the user = uuid
*/
- @NonNull
- SortedSet getUserHistory(@NonNull UUID uuid);
+ @NonNull SortedSet getUserHistory(@NonNull UUID uuid);
/**
* Gets the log content for a given group
@@ -74,8 +71,7 @@ public interface Log {
* @param name the name to filter by
* @return all content in this log where the group = name
*/
- @NonNull
- SortedSet getGroupHistory(@NonNull String name);
+ @NonNull SortedSet getGroupHistory(@NonNull String name);
/**
* Gets the log content for a given track
@@ -83,7 +79,6 @@ public interface Log {
* @param name the name to filter by
* @return all content in this log where the track = name
*/
- @NonNull
- SortedSet getTrackHistory(@NonNull String name);
+ @NonNull SortedSet getTrackHistory(@NonNull String name);
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/LogEntry.java b/api/src/main/java/me/lucko/luckperms/api/LogEntry.java
index abc2f672..093b4913 100644
--- a/api/src/main/java/me/lucko/luckperms/api/LogEntry.java
+++ b/api/src/main/java/me/lucko/luckperms/api/LogEntry.java
@@ -52,24 +52,21 @@ public interface LogEntry extends Comparable {
*
* @return the actor id
*/
- @NonNull
- UUID getActor();
+ @NonNull UUID getActor();
/**
* Gets the name describing the actor.
*
* @return the name of the actor
*/
- @NonNull
- String getActorName();
+ @NonNull String getActorName();
/**
* Gets the type of action.
*
* @return the action type
*/
- @NonNull
- Type getType();
+ @NonNull Type getType();
/**
* Gets the uuid of the object which was acted upon.
@@ -78,16 +75,14 @@ public interface LogEntry extends Comparable {
*
* @return the uuid of acted object
*/
- @NonNull
- Optional getActed();
+ @NonNull Optional getActed();
/**
* Gets the name describing the object which was acted upon
*
* @return the name of the acted object
*/
- @NonNull
- String getActedName();
+ @NonNull String getActedName();
/**
* Returns a string describing the action which took place.
@@ -97,8 +92,7 @@ public interface LogEntry extends Comparable {
*
* @return the action
*/
- @NonNull
- String getAction();
+ @NonNull String getAction();
/**
* Represents the type of a {@link LogEntry}.
@@ -106,19 +100,7 @@ public interface LogEntry extends Comparable {
* @since 3.3
*/
enum Type {
- USER('U'),
- GROUP('G'),
- TRACK('T');
-
- private final char code;
-
- Type(char code) {
- this.code = code;
- }
-
- public char getCode() {
- return this.code;
- }
+ USER('U'), GROUP('G'), TRACK('T');
public static @NonNull Type valueOf(char code) {
switch (code) {
@@ -135,6 +117,16 @@ public interface LogEntry extends Comparable {
throw new IllegalArgumentException("Unknown code: " + code);
}
}
+
+ private final char code;
+
+ Type(char code) {
+ this.code = code;
+ }
+
+ public char getCode() {
+ return this.code;
+ }
}
/**
@@ -149,8 +141,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getTimestamp()
*/
- @NonNull
- Builder setTimestamp(long timestamp);
+ @NonNull Builder setTimestamp(long timestamp);
/**
* Sets the actor of the entry.
@@ -159,8 +150,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getActor()
*/
- @NonNull
- Builder setActor(@NonNull UUID actor);
+ @NonNull Builder setActor(@NonNull UUID actor);
/**
* Sets the actor name of the entry.
@@ -169,8 +159,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getActorName()
*/
- @NonNull
- Builder setActorName(@NonNull String actorName);
+ @NonNull Builder setActorName(@NonNull String actorName);
/**
* Sets the type of the entry.
@@ -179,8 +168,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getType()
*/
- @NonNull
- Builder setType(@NonNull Type type);
+ @NonNull Builder setType(@NonNull Type type);
/**
* Sets the acted object for the entry.
@@ -189,8 +177,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getActed()
*/
- @NonNull
- Builder setActed(@Nullable UUID acted);
+ @NonNull Builder setActed(@Nullable UUID acted);
/**
* Sets the acted name for the entry.
@@ -199,8 +186,7 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getActedName()
*/
- @NonNull
- Builder setActedName(@NonNull String actedName);
+ @NonNull Builder setActedName(@NonNull String actedName);
/**
* Sets the action of the entry.
@@ -209,16 +195,14 @@ public interface LogEntry extends Comparable {
* @return the builder
* @see LogEntry#getAction()
*/
- @NonNull
- Builder setAction(@NonNull String action);
+ @NonNull Builder setAction(@NonNull String action);
/**
* Creates a {@link LogEntry} instance from the builder.
*
* @return a new log entry instance
*/
- @NonNull
- LogEntry build();
+ @NonNull LogEntry build();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java b/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java
index 5df2c2ea..0fc35278 100644
--- a/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java
+++ b/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java
@@ -62,8 +62,7 @@ public interface LuckPermsApi {
* @return the platform info
* @since 4.0
*/
- @NonNull
- PlatformInfo getPlatformInfo();
+ @NonNull PlatformInfo getPlatformInfo();
/**
* Gets the {@link UserManager}, responsible for managing
@@ -78,8 +77,7 @@ public interface LuckPermsApi {
* @return the user manager
* @since 4.0
*/
- @NonNull
- UserManager getUserManager();
+ @NonNull UserManager getUserManager();
/**
* Gets the {@link GroupManager}, responsible for managing
@@ -94,8 +92,7 @@ public interface LuckPermsApi {
* @return the group manager
* @since 4.0
*/
- @NonNull
- GroupManager getGroupManager();
+ @NonNull GroupManager getGroupManager();
/**
* Gets the {@link TrackManager}, responsible for managing
@@ -110,8 +107,7 @@ public interface LuckPermsApi {
* @return the track manager
* @since 4.0
*/
- @NonNull
- TrackManager getTrackManager();
+ @NonNull TrackManager getTrackManager();
/**
* Schedules the execution of an update task, and returns an encapsulation
@@ -125,8 +121,7 @@ public interface LuckPermsApi {
* @return a future
* @since 4.0
*/
- @NonNull
- CompletableFuture runUpdateTask();
+ @NonNull CompletableFuture runUpdateTask();
/**
* Gets the {@link EventBus}, used for subscribing to internal LuckPerms
@@ -135,16 +130,14 @@ public interface LuckPermsApi {
* @return the event bus
* @since 3.0
*/
- @NonNull
- EventBus getEventBus();
+ @NonNull EventBus getEventBus();
/**
* Gets a representation of the plugins configuration
*
* @return the configuration
*/
- @NonNull
- LPConfiguration getConfiguration();
+ @NonNull LPConfiguration getConfiguration();
/**
* Gets an object representing the plugins primary {@link Storage} backend.
@@ -155,8 +148,7 @@ public interface LuckPermsApi {
* @return a storage instance
* @since 2.14
*/
- @NonNull
- Storage getStorage();
+ @NonNull Storage getStorage();
/**
* Gets the {@link MessagingService}, if present.
@@ -170,8 +162,7 @@ public interface LuckPermsApi {
*
* @return the messaging service instance, if present.
*/
- @NonNull
- Optional getMessagingService();
+ @NonNull Optional getMessagingService();
/**
* Registers a {@link MessengerProvider} for use by the platform.
@@ -193,8 +184,7 @@ public interface LuckPermsApi {
* @return the action logger
* @since 4.1
*/
- @NonNull
- ActionLogger getActionLogger();
+ @NonNull ActionLogger getActionLogger();
/**
* Gets a {@link UuidCache}.
@@ -204,11 +194,10 @@ public interface LuckPermsApi {
*
* @return the uuid cache
* @deprecated this feature is now handled internally - and the API returns a
- * No-op implementation of this class.
+ * No-op implementation of this class.
*/
- @NonNull
@Deprecated
- UuidCache getUuidCache();
+ @NonNull UuidCache getUuidCache();
/**
* Gets the {@link ContextManager}.
@@ -219,8 +208,7 @@ public interface LuckPermsApi {
* @return the context manager
* @since 4.0
*/
- @NonNull
- ContextManager getContextManager();
+ @NonNull ContextManager getContextManager();
/**
* Gets the {@link NodeFactory}.
@@ -229,8 +217,7 @@ public interface LuckPermsApi {
*
* @return the node factory
*/
- @NonNull
- NodeFactory getNodeFactory();
+ @NonNull NodeFactory getNodeFactory();
/**
* Gets the {@link MetaStackFactory}.
@@ -242,8 +229,7 @@ public interface LuckPermsApi {
* @return the meta stack factory
* @since 3.2
*/
- @NonNull
- MetaStackFactory getMetaStackFactory();
+ @NonNull MetaStackFactory getMetaStackFactory();
diff --git a/api/src/main/java/me/lucko/luckperms/api/Node.java b/api/src/main/java/me/lucko/luckperms/api/Node.java
index 3d6de6ed..8d360e98 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Node.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Node.java
@@ -70,13 +70,13 @@ import java.util.stream.Stream;
*
Nodes have the following attributes:
*
*
- *
{@link #getPermission() permission} - the actual permission string
- *
{@link #getValue() value} - the value of the node (false for negated)
- *
{@link #isOverride() override} - if the node is marked as having special priority over other nodes
- *
{@link #getServer() server} - the specific server where this node should apply
- *
{@link #getWorld() world} - the specific world where this node should apply
- *
{@link #getContexts() context} - the additional contexts required for this node to apply
- *
{@link #getExpiry() expiry} - the time when this node should expire
+ *
{@link #getPermission() permission} - the actual permission string
+ *
{@link #getValue() value} - the value of the node (false for negated)
+ *
{@link #isOverride() override} - if the node is marked as having special priority over other nodes
+ *
{@link #getServer() server} - the specific server where this node should apply
+ *
{@link #getWorld() world} - the specific world where this node should apply
+ *
{@link #getContexts() context} - the additional contexts required for this node to apply
+ *
{@link #getExpiry() expiry} - the time when this node should expire
*
*
*
The 'permission' property of a {@link Node} is also used in some cases to represent state
@@ -89,13 +89,13 @@ import java.util.stream.Stream;
*
The current types are:
*
*
- *
normal - just a regular permission
- *
{@link InheritanceType} - an "inheritance node" marks that the holder should inherit data from another group
- *
{@link PrefixType} - represents an assigned prefix
- *
{@link SuffixType} - represents an assigned suffix
- *
{@link MetaType} - represents an assigned meta option
- *
{@link WeightType} - marks the weight of the object holding this node
- *
{@link DisplayNameType} - marks the display name of the object holding this node
+ *
normal - just a regular permission
+ *
{@link InheritanceType} - an "inheritance node" marks that the holder should inherit data from another group
+ *
{@link PrefixType} - represents an assigned prefix
+ *
{@link SuffixType} - represents an assigned suffix
+ *
{@link MetaType} - represents an assigned meta option
+ *
{@link WeightType} - marks the weight of the object holding this node
+ *
{@link DisplayNameType} - marks the display name of the object holding this node
*
*
*
The core node state must be immutable in all implementations.
@@ -113,8 +113,7 @@ public interface Node {
*
* @return the actual permission node
*/
- @NonNull
- String getPermission();
+ @NonNull String getPermission();
/**
* Gets the value of the node.
@@ -160,16 +159,14 @@ public interface Node {
*
* @return an {@link Optional} containing the server, if one is defined
*/
- @NonNull
- Optional getServer();
+ @NonNull Optional getServer();
/**
* Gets the world this node applies on, if the node is world specific.
*
* @return an {@link Optional} containing the world, if one is defined
*/
- @NonNull
- Optional getWorld();
+ @NonNull Optional getWorld();
/**
* Gets if this node is server specific.
@@ -218,8 +215,7 @@ public interface Node {
*
* @return a list of full nodes
*/
- @NonNull
- List resolveShorthand();
+ @NonNull List resolveShorthand();
/**
* Gets if this node is assigned temporarily.
@@ -251,8 +247,7 @@ public interface Node {
* @return the {@link Date} when this node will expire
* @throws IllegalStateException if the node is not temporary
*/
- @NonNull
- Date getExpiry() throws IllegalStateException;
+ @NonNull Date getExpiry() throws IllegalStateException;
/**
* Gets the number of seconds until this permission will expire.
@@ -279,20 +274,18 @@ public interface Node {
* @return the extra contexts required for this node to apply
* @since 2.13
*/
- @NonNull
- ContextSet getContexts();
+ @NonNull ContextSet getContexts();
/**
* The same as {@link #getContexts()}, but also includes context pairs for
* "server" and "world" keys if present.
*
* @return the full contexts required for this node to apply
- * @since 3.1
* @see Contexts#SERVER_KEY
* @see Contexts#WORLD_KEY
+ * @since 3.1
*/
- @NonNull
- ContextSet getFullContexts();
+ @NonNull ContextSet getFullContexts();
/**
* Gets if this node is a wildcard permission.
@@ -344,10 +337,7 @@ public interface Node {
* @since 4.2
*/
default T typeData(NodeTypeKey key) throws IllegalStateException {
- return getTypeData(key)
- .orElseThrow(() ->
- new IllegalStateException("Node '" + getPermission() + "' does not have the '" + key.getTypeName() + "' type.")
- );
+ return getTypeData(key).orElseThrow(() -> new IllegalStateException("Node '" + getPermission() + "' does not have the '" + key.getTypeName() + "' type."));
}
/**
@@ -444,7 +434,7 @@ public interface Node {
* Gets if this Node is equal to another node as defined by the given
* {@link StandardNodeEquality} predicate.
*
- * @param other the other node
+ * @param other the other node
* @param equalityPredicate the predicate
* @return true if this node is considered equal
* @since 4.1
@@ -455,7 +445,7 @@ public interface Node {
* Gets if this Node is equal to another node as defined by the given
* {@link NodeEqualityPredicate}.
*
- * @param other the other node
+ * @param other the other node
* @param equalityPredicate the predicate
* @return true if this node is considered equal
* @since 4.1
@@ -470,8 +460,8 @@ public interface Node {
*
* @param other the other node
* @return true if the two nodes are almost equal
- * @deprecated in favour of {@link #equals(Node, NodeEqualityPredicate)}
* @see StandardNodeEquality#IGNORE_VALUE
+ * @deprecated in favour of {@link #equals(Node, NodeEqualityPredicate)}
*/
@Deprecated
default boolean equalsIgnoringValue(@NonNull Node other) {
@@ -484,8 +474,8 @@ public interface Node {
*
* @param other the other node
* @return true if the two nodes are almost equal
- * @deprecated in favour of {@link #equals(Node, NodeEqualityPredicate)}
* @see StandardNodeEquality#IGNORE_EXPIRY_TIME_AND_VALUE
+ * @deprecated in favour of {@link #equals(Node, NodeEqualityPredicate)}
*/
@Deprecated
default boolean almostEquals(@NonNull Node other) {
@@ -498,9 +488,9 @@ public interface Node {
*
* @param other the other node
* @return true if the two nodes are almost equal
+ * @see StandardNodeEquality#IGNORE_VALUE_OR_IF_TEMPORARY
* @since 2.8
* @deprecated in favour of {@link #equals(Node, NodeEqualityPredicate)}
- * @see StandardNodeEquality#IGNORE_VALUE_OR_IF_TEMPORARY
*/
@Deprecated
default boolean equalsIgnoringValueOrTemp(@NonNull Node other) {
@@ -541,8 +531,7 @@ public interface Node {
* @return the builder
* @see Node#isNegated()
*/
- @NonNull
- Builder setNegated(boolean negated);
+ @NonNull Builder setNegated(boolean negated);
/**
* Sets the value of the node.
@@ -551,8 +540,7 @@ public interface Node {
* @return the builder
* @see Node#getValue()
*/
- @NonNull
- Builder setValue(boolean value);
+ @NonNull Builder setValue(boolean value);
/**
* Sets the override property for the node.
@@ -564,8 +552,7 @@ public interface Node {
* @return the builder
* @see Node#isOverride()
*/
- @NonNull
- Builder setOverride(boolean override);
+ @NonNull Builder setOverride(boolean override);
/**
* Sets the time when the node should expire.
@@ -577,8 +564,7 @@ public interface Node {
* @return the builder
* @see Node#getExpiryUnixTime()
*/
- @NonNull
- Builder setExpiry(long expiryUnixTimestamp);
+ @NonNull Builder setExpiry(long expiryUnixTimestamp);
/**
* Sets the time when the node should expire.
@@ -587,7 +573,7 @@ public interface Node {
* system time.
*
* @param duration how long the node should be added for
- * @param unit the unit duration is measured in
+ * @param unit the unit duration is measured in
* @return the builder
* @since 4.2
*/
@@ -604,8 +590,7 @@ public interface Node {
* @return the builder
* @since 4.2
*/
- @NonNull
- Builder clearExpiry();
+ @NonNull Builder clearExpiry();
/**
* Sets the world value for the node.
@@ -614,8 +599,7 @@ public interface Node {
* @return the builder
* @see Node#getWorld()
*/
- @NonNull
- Builder setWorld(@Nullable String world);
+ @NonNull Builder setWorld(@Nullable String world);
/**
* Sets the server value for the node.
@@ -624,20 +608,18 @@ public interface Node {
* @return the builder
* @see Node#getServer()
*/
- @NonNull
- Builder setServer(@Nullable String server);
+ @NonNull Builder setServer(@Nullable String server);
/**
* Appends an extra context onto the node.
*
- * @param key the context key
+ * @param key the context key
* @param value the context value
* @return the builder
* @see ContextSet
* @see Node#getContexts()
*/
- @NonNull
- Builder withExtraContext(@NonNull String key, @NonNull String value);
+ @NonNull Builder withExtraContext(@NonNull String key, @NonNull String value);
/**
* Appends extra contexts onto the node.
@@ -647,8 +629,7 @@ public interface Node {
* @see ContextSet
* @see Node#getContexts()
*/
- @NonNull
- Builder withExtraContext(@NonNull Map map);
+ @NonNull Builder withExtraContext(@NonNull Map map);
/**
* Appends extra contexts onto the node.
@@ -658,8 +639,7 @@ public interface Node {
* @see ContextSet
* @see Node#getContexts()
*/
- @NonNull
- Builder withExtraContext(@NonNull Set> context);
+ @NonNull Builder withExtraContext(@NonNull Set> context);
/**
* Appends an extra context onto the node.
@@ -669,8 +649,7 @@ public interface Node {
* @see ContextSet
* @see Node#getContexts()
*/
- @NonNull
- Builder withExtraContext(Map.@NonNull Entry entry);
+ @NonNull Builder withExtraContext(Map.@NonNull Entry entry);
/**
* Appends extra contexts onto the node.
@@ -680,8 +659,7 @@ public interface Node {
* @see ContextSet
* @see Node#getContexts()
*/
- @NonNull
- Builder withExtraContext(@NonNull ContextSet contextSet);
+ @NonNull Builder withExtraContext(@NonNull ContextSet contextSet);
/**
* Sets the extra contexts for the node.
@@ -692,16 +670,14 @@ public interface Node {
* @see Node#getContexts()
* @since 4.2
*/
- @NonNull
- Builder setExtraContext(@NonNull ContextSet contextSet);
+ @NonNull Builder setExtraContext(@NonNull ContextSet contextSet);
/**
* Creates a {@link Node} instance from the builder.
*
* @return a new node instance
*/
- @NonNull
- Node build();
+ @NonNull Node build();
}
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java b/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java
index f97c405e..226eeca8 100644
--- a/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java
+++ b/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java
@@ -69,7 +69,7 @@ public interface NodeFactory {
*
* @param groupName the name of the group
* @return a node builder instance
- * @throws NullPointerException if the groupName is null
+ * @throws NullPointerException if the groupName is null
* @since 4.0
*/
Node.@NonNull Builder makeGroupNode(@NonNull String groupName);
@@ -87,9 +87,9 @@ public interface NodeFactory {
/**
* Creates a node builder for the given chat meta type
*
- * @param type the type
+ * @param type the type
* @param priority the priority
- * @param value the value for the prefix/suffix
+ * @param value the value for the prefix/suffix
* @return a node builder instance
* @throws NullPointerException if the type or value is null
* @since 3.2
diff --git a/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java b/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java
index 7e37b8ce..48d1c11b 100644
--- a/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java
+++ b/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java
@@ -68,8 +68,7 @@ public interface PermissionHolder {
*
* @return the identifier for this object. Either a uuid string or name.
*/
- @NonNull
- String getObjectName();
+ @NonNull String getObjectName();
/**
* Gets a friendly name for this holder, to be displayed in command output, etc.
@@ -86,8 +85,7 @@ public interface PermissionHolder {
* @return a friendly identifier for this holder
* @since 3.2
*/
- @NonNull
- String getFriendlyName();
+ @NonNull String getFriendlyName();
/**
* Gets the holders {@link CachedData} cache.
@@ -95,8 +93,7 @@ public interface PermissionHolder {
* @return the holders cached data.
* @since 3.2
*/
- @NonNull
- CachedData getCachedData();
+ @NonNull CachedData getCachedData();
/**
* Refreshes and applies any changes to the cached holder data.
@@ -107,8 +104,7 @@ public interface PermissionHolder {
* @return the task future
* @since 4.0
*/
- @NonNull
- CompletableFuture refreshCachedData();
+ @NonNull CompletableFuture refreshCachedData();
/**
* Gets the backing multimap containing every permission this holder has.
@@ -119,8 +115,7 @@ public interface PermissionHolder {
* @return the holders own permissions
* @since 3.3
*/
- @NonNull
- ImmutableSetMultimap getNodes();
+ @NonNull ImmutableSetMultimap getNodes();
/**
* Gets the backing multimap containing every transient permission this holder has.
@@ -132,8 +127,7 @@ public interface PermissionHolder {
* @return the holders own permissions
* @since 3.3
*/
- @NonNull
- ImmutableSetMultimap getTransientNodes();
+ @NonNull ImmutableSetMultimap getTransientNodes();
/**
* Gets a flattened/squashed view of the holders permissions.
@@ -150,8 +144,7 @@ public interface PermissionHolder {
* @return a list of the holders own nodes.
* @since 3.3
*/
- @NonNull
- List getOwnNodes();
+ @NonNull List getOwnNodes();
/**
* Gets a sorted set of all held permissions.
@@ -166,8 +159,7 @@ public interface PermissionHolder {
* @return an immutable set of permissions in priority order
* @since 2.6
*/
- @NonNull
- SortedSet extends Node> getPermissions();
+ @NonNull SortedSet extends Node> getPermissions();
/**
* Similar to {@link #getPermissions()}, except only including permissions from the enduring
@@ -184,8 +176,7 @@ public interface PermissionHolder {
* @return a set of nodes
* @since 2.6
*/
- @NonNull
- Set extends Node> getEnduringPermissions();
+ @NonNull Set extends Node> getEnduringPermissions();
/**
* Similar to {@link #getPermissions()}, except only including permissions from the enduring
@@ -201,8 +192,7 @@ public interface PermissionHolder {
* @return a set of nodes
* @since 2.6
*/
- @NonNull
- Set extends Node> getTransientPermissions();
+ @NonNull Set extends Node> getTransientPermissions();
/**
* A filtered view of this holders nodes, only including permanent entries.
@@ -217,8 +207,7 @@ public interface PermissionHolder {
* @return a set of permanent nodes
* @since 2.6
*/
- @NonNull
- Set getPermanentPermissionNodes();
+ @NonNull Set getPermanentPermissionNodes();
/**
* A filtered view of this holders nodes, only including temporary entries.
@@ -233,8 +222,7 @@ public interface PermissionHolder {
* @return a set of temporary nodes
* @since 2.6
*/
- @NonNull
- Set getTemporaryPermissionNodes();
+ @NonNull Set getTemporaryPermissionNodes();
/**
* Recursively resolves this holders permissions.
@@ -252,8 +240,7 @@ public interface PermissionHolder {
* @return a list of nodes
* @since 3.3
*/
- @NonNull
- List resolveInheritances(@NonNull Contexts contexts);
+ @NonNull List resolveInheritances(@NonNull Contexts contexts);
/**
* Recursively resolves this holders permissions.
@@ -273,8 +260,7 @@ public interface PermissionHolder {
* @return a list of nodes
* @since 3.3
*/
- @NonNull
- List resolveInheritances();
+ @NonNull List resolveInheritances();
/**
* Gets a mutable sorted set of the nodes that this object has and inherits, filtered by context
@@ -290,8 +276,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the context is null
* @since 2.11
*/
- @NonNull
- SortedSet getAllNodes(@NonNull Contexts contexts);
+ @NonNull SortedSet getAllNodes(@NonNull Contexts contexts);
/**
* Gets a mutable sorted set of the nodes that this object has and inherits.
@@ -305,8 +290,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the context is null
* @since 3.3
*/
- @NonNull
- SortedSet getAllNodes();
+ @NonNull SortedSet getAllNodes();
/**
* Gets a mutable set of the nodes that this object has and inherits, filtered by context.
@@ -319,19 +303,17 @@ public interface PermissionHolder {
* @throws NullPointerException if the context is null
* @since 2.11
*/
- @NonNull
- Set getAllNodesFiltered(@NonNull Contexts contexts);
+ @NonNull Set getAllNodesFiltered(@NonNull Contexts contexts);
/**
* Converts the output of {@link #getAllNodesFiltered(Contexts)} into string and boolean form,
* and expands shorthand permissions.
*
- * @param contexts the context for the lookup
+ * @param contexts the context for the lookup
* @param convertToLowercase if the keys should be made lowercase whilst being exported
* @return a mutable map of permissions
*/
- @NonNull
- Map exportNodes(@NonNull Contexts contexts, boolean convertToLowercase);
+ @NonNull Map exportNodes(@NonNull Contexts contexts, boolean convertToLowercase);
/**
* Removes any temporary permissions that have expired.
@@ -346,42 +328,39 @@ public interface PermissionHolder {
*
*
Although this method is named hasPermission, it can be used for all node types.
*
- * @param node the node to check for
+ * @param node the node to check for
* @param equalityPredicate how to determine if a node matches
* @return a Tristate for the holders permission status for the node
* @throws NullPointerException if the node is null
* @since 4.1
*/
- @NonNull
- Tristate hasPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
+ @NonNull Tristate hasPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
/**
* Checks to see if the object has a certain permission.
*
*
Although this method is named hasTransientPermission, it can be used for all node types.
*
- * @param node the node to check for
+ * @param node the node to check for
* @param equalityPredicate how to determine if a node matches
* @return a Tristate for the holders permission status for the node
* @throws NullPointerException if the node is null
* @since 4.1
*/
- @NonNull
- Tristate hasTransientPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
+ @NonNull Tristate hasTransientPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
/**
* Checks to see if the object inherits a certain permission.
*
*
Although this method is named inheritsPermission, it can be used for all node types.
*
- * @param node the node to check for
+ * @param node the node to check for
* @param equalityPredicate how to determine if a node matches
* @return a Tristate for the holders inheritance status for the node
* @throws NullPointerException if the node is null
* @since 4.1
*/
- @NonNull
- Tristate inheritsPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
+ @NonNull Tristate inheritsPermission(@NonNull Node node, @NonNull NodeEqualityPredicate equalityPredicate);
/**
* Checks to see if the object has a certain permission.
@@ -393,8 +372,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 2.6
*/
- @NonNull
- Tristate hasPermission(@NonNull Node node);
+ @NonNull Tristate hasPermission(@NonNull Node node);
/**
* Checks to see if the object has a certain permission.
@@ -406,8 +384,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 2.6
*/
- @NonNull
- Tristate hasTransientPermission(@NonNull Node node);
+ @NonNull Tristate hasTransientPermission(@NonNull Node node);
/**
* Checks to see if the object inherits a certain permission.
@@ -419,8 +396,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 2.6
*/
- @NonNull
- Tristate inheritsPermission(@NonNull Node node);
+ @NonNull Tristate inheritsPermission(@NonNull Node node);
/**
* Check to see if this holder inherits another group in the global context.
@@ -442,7 +418,7 @@ public interface PermissionHolder {
*
*
This method only checks for direct inheritance - one hop up the inheritance tree.
*
- * @param group The group to check membership of
+ * @param group The group to check membership of
* @param contextSet the context set to filter by
* @return true if the group inherits the other group
* @throws NullPointerException if the group is null
@@ -472,8 +448,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 4.0
*/
- @NonNull
- DataMutateResult setPermission(@NonNull Node node);
+ @NonNull DataMutateResult setPermission(@NonNull Node node);
/**
* Sets a permission node for the permission holder.
@@ -491,14 +466,13 @@ public interface PermissionHolder {
* made already. This can be done via {@link UserManager#loadUser(UUID)} or
* {@link GroupManager#loadGroup(String)} respectively.
*
- * @param node The node to be set
+ * @param node The node to be set
* @param temporaryMergeBehaviour The behaviour used to merge temporary permission entries
* @return the result of the operation
* @throws NullPointerException if the node is null
* @since 4.3
*/
- @NonNull
- TemporaryDataMutateResult setPermission(@NonNull Node node, @NonNull TemporaryMergeBehaviour temporaryMergeBehaviour);
+ @NonNull TemporaryDataMutateResult setPermission(@NonNull Node node, @NonNull TemporaryMergeBehaviour temporaryMergeBehaviour);
/**
* Sets a transient permission for the permission holder.
@@ -521,8 +495,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 4.0
*/
- @NonNull
- DataMutateResult setTransientPermission(@NonNull Node node);
+ @NonNull DataMutateResult setTransientPermission(@NonNull Node node);
/**
* Sets a transient permission for the permission holder.
@@ -540,14 +513,13 @@ public interface PermissionHolder {
*
*
Although this method is named setTransientPermission, it can be used for all node types.
*
- * @param node The node to be se
+ * @param node The node to be se
* @param temporaryMergeBehaviour The behaviour used to merge temporary permission entries
* @return the result of the operation
* @throws NullPointerException if the node is null
* @since 4.3
*/
- @NonNull
- TemporaryDataMutateResult setTransientPermission(@NonNull Node node, @NonNull TemporaryMergeBehaviour temporaryMergeBehaviour);
+ @NonNull TemporaryDataMutateResult setTransientPermission(@NonNull Node node, @NonNull TemporaryMergeBehaviour temporaryMergeBehaviour);
/**
* Unsets a permission for the permission holder.
@@ -570,8 +542,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 4.0
*/
- @NonNull
- DataMutateResult unsetPermission(@NonNull Node node);
+ @NonNull DataMutateResult unsetPermission(@NonNull Node node);
/**
* Unsets a transient permission for the permission holder.
@@ -583,8 +554,7 @@ public interface PermissionHolder {
* @throws NullPointerException if the node is null
* @since 4.0
*/
- @NonNull
- DataMutateResult unsetTransientPermission(@NonNull Node node);
+ @NonNull DataMutateResult unsetTransientPermission(@NonNull Node node);
/**
* Clears any nodes from the holder which pass the predicate.
@@ -780,8 +750,8 @@ public interface PermissionHolder {
* Unsets a permission for the permission holder.
*
* @param node The node to be unset
- * @throws NullPointerException if the node is null
* @return the result of the operation
+ * @throws NullPointerException if the node is null
* @since 3.1
* @deprecated now forwards to {@link #unsetPermission(Node)}
*/
@@ -794,8 +764,8 @@ public interface PermissionHolder {
* Unsets a transient permission for the permission holder.
*
* @param node The node to be unset
- * @throws NullPointerException if the node is null
* @return the result of the operation
+ * @throws NullPointerException if the node is null
* @since 3.1
* @deprecated now forwards to {@link #unsetTransientPermission(Node)}
*/
diff --git a/api/src/main/java/me/lucko/luckperms/api/PlayerSaveResult.java b/api/src/main/java/me/lucko/luckperms/api/PlayerSaveResult.java
index 8b74373f..95128358 100644
--- a/api/src/main/java/me/lucko/luckperms/api/PlayerSaveResult.java
+++ b/api/src/main/java/me/lucko/luckperms/api/PlayerSaveResult.java
@@ -48,8 +48,7 @@ public interface PlayerSaveResult {
*
* @return the status
*/
- @NonNull
- Set getStatus();
+ @NonNull Set getStatus();
/**
* Gets if the result includes a certain status code.
@@ -65,8 +64,7 @@ public interface PlayerSaveResult {
* @return the old username
* @see Status#USERNAME_UPDATED
*/
- @Nullable
- String getOldUsername();
+ @Nullable String getOldUsername();
/**
* Gets the other uuids involved in the result
@@ -74,8 +72,7 @@ public interface PlayerSaveResult {
* @return the other uuids
* @see Status#OTHER_UUIDS_PRESENT_FOR_USERNAME
*/
- @Nullable
- Set getOtherUuids();
+ @Nullable Set getOtherUuids();
/**
* The various states the result can take
diff --git a/api/src/main/java/me/lucko/luckperms/api/PromotionResult.java b/api/src/main/java/me/lucko/luckperms/api/PromotionResult.java
index a3e61e17..68ecf0ff 100644
--- a/api/src/main/java/me/lucko/luckperms/api/PromotionResult.java
+++ b/api/src/main/java/me/lucko/luckperms/api/PromotionResult.java
@@ -41,8 +41,7 @@ public interface PromotionResult extends MutateResult {
*
* @return the status
*/
- @NonNull
- Status getStatus();
+ @NonNull Status getStatus();
@Override
default boolean wasSuccess() {
@@ -57,8 +56,7 @@ public interface PromotionResult extends MutateResult {
*
* @return the group the user was promoted from.
*/
- @NonNull
- Optional getGroupFrom();
+ @NonNull Optional getGroupFrom();
/**
* Gets the name of the group the user was promoted from, if applicable.
@@ -71,8 +69,7 @@ public interface PromotionResult extends MutateResult {
*
* @return the group the user was promoted to.
*/
- @NonNull
- Optional getGroupTo();
+ @NonNull Optional getGroupTo();
/**
* The result status
diff --git a/api/src/main/java/me/lucko/luckperms/api/Storage.java b/api/src/main/java/me/lucko/luckperms/api/Storage.java
index 64d5e099..48281bfa 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Storage.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Storage.java
@@ -50,8 +50,7 @@ public interface Storage {
*
* @return the name of the implementation
*/
- @NonNull
- String getName();
+ @NonNull String getName();
/**
* Gets whether the storage instance is allowing logins on the platform.
@@ -70,9 +69,8 @@ public interface Storage {
* @throws NullPointerException if entry is null
* @deprecated in favour of {@link ActionLogger#submit(LogEntry)}.
*/
- @NonNull
@Deprecated
- CompletableFuture logAction(@NonNull LogEntry entry);
+ @NonNull CompletableFuture logAction(@NonNull LogEntry entry);
/**
* Loads and returns the entire log from storage
@@ -80,9 +78,8 @@ public interface Storage {
* @return a log instance, could be null if loading failed
* @deprecated in favour of {@link ActionLogger#getLog()}
*/
- @NonNull
@Deprecated
- CompletableFuture getLog();
+ @NonNull CompletableFuture getLog();
/**
* Loads a user's data from the main storage into the plugins local storage.
@@ -93,9 +90,8 @@ public interface Storage {
* @throws NullPointerException if uuid is null
* @deprecated in favour of {@link UserManager#loadUser(UUID, String)}
*/
- @NonNull
@Deprecated
- CompletableFuture loadUser(@NonNull UUID uuid, @Nullable String username);
+ @NonNull CompletableFuture loadUser(@NonNull UUID uuid, @Nullable String username);
/**
* Loads a user's data from the main storage into the plugins local storage.
@@ -121,9 +117,8 @@ public interface Storage {
* @throws IllegalStateException if the user instance was not obtained from LuckPerms.
* @deprecated in favour of {@link UserManager#saveUser(User)}
*/
- @NonNull
@Deprecated
- CompletableFuture saveUser(@NonNull User user);
+ @NonNull CompletableFuture saveUser(@NonNull User user);
/**
* Gets a set all "unique" user UUIDs.
@@ -133,9 +128,8 @@ public interface Storage {
* @return a set of uuids, or null if the operation failed.
* @deprecated in favour of {@link UserManager#getUniqueUsers()}
*/
- @NonNull
@Deprecated
- CompletableFuture> getUniqueUsers();
+ @NonNull CompletableFuture> getUniqueUsers();
/**
* Searches for a list of users with a given permission.
@@ -146,9 +140,8 @@ public interface Storage {
* @since 2.17
* @deprecated in favour of {@link UserManager#getWithPermission(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture>> getUsersWithPermission(@NonNull String permission);
+ @NonNull CompletableFuture>> getUsersWithPermission(@NonNull String permission);
/**
* Creates and loads a group into the plugins local storage
@@ -159,9 +152,8 @@ public interface Storage {
* @throws IllegalArgumentException if the name is invalid
* @deprecated in favour of {@link GroupManager#createAndLoadGroup(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture createAndLoadGroup(@NonNull String name);
+ @NonNull CompletableFuture createAndLoadGroup(@NonNull String name);
/**
* Loads a group into the plugins local storage.
@@ -172,9 +164,8 @@ public interface Storage {
* @throws IllegalArgumentException if the name is invalid
* @deprecated in favour of {@link GroupManager#loadGroup(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture loadGroup(@NonNull String name);
+ @NonNull CompletableFuture loadGroup(@NonNull String name);
/**
* Loads all groups from the storage into memory
@@ -182,9 +173,8 @@ public interface Storage {
* @return true if the operation completed successfully.
* @deprecated in favour of {@link GroupManager#loadAllGroups()}
*/
- @NonNull
@Deprecated
- CompletableFuture loadAllGroups();
+ @NonNull CompletableFuture loadAllGroups();
/**
* Saves a group back to storage.
@@ -197,9 +187,8 @@ public interface Storage {
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @deprecated in favour of {@link GroupManager#saveGroup(Group)}
*/
- @NonNull
@Deprecated
- CompletableFuture saveGroup(@NonNull Group group);
+ @NonNull CompletableFuture saveGroup(@NonNull Group group);
/**
* Permanently deletes a group from storage.
@@ -210,9 +199,8 @@ public interface Storage {
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @deprecated in favour of {@link GroupManager#deleteGroup(Group)}
*/
- @NonNull
@Deprecated
- CompletableFuture deleteGroup(@NonNull Group group);
+ @NonNull CompletableFuture deleteGroup(@NonNull Group group);
/**
* Searches for a list of groups with a given permission.
@@ -223,9 +211,8 @@ public interface Storage {
* @since 2.17
* @deprecated in favour of {@link GroupManager#getWithPermission(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture>> getGroupsWithPermission(@NonNull String permission);
+ @NonNull CompletableFuture>> getGroupsWithPermission(@NonNull String permission);
/**
* Creates and loads a track into the plugins local storage
@@ -236,9 +223,8 @@ public interface Storage {
* @throws IllegalArgumentException if the name is invalid
* @deprecated in favour of {@link TrackManager#createAndLoadTrack(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture createAndLoadTrack(@NonNull String name);
+ @NonNull CompletableFuture createAndLoadTrack(@NonNull String name);
/**
* Loads a track into the plugins local storage.
@@ -249,9 +235,8 @@ public interface Storage {
* @throws IllegalArgumentException if the name is invalid
* @deprecated in favour of {@link TrackManager#loadTrack(String)}
*/
- @NonNull
@Deprecated
- CompletableFuture loadTrack(@NonNull String name);
+ @NonNull CompletableFuture loadTrack(@NonNull String name);
/**
* Loads all tracks from the storage into memory
@@ -259,9 +244,8 @@ public interface Storage {
* @return true if the operation completed successfully.
* @deprecated in favour of {@link TrackManager#loadAllTracks()}
*/
- @NonNull
@Deprecated
- CompletableFuture loadAllTracks();
+ @NonNull CompletableFuture loadAllTracks();
/**
* Saves a track back to storage. You should call this after you make any changes to a track.
@@ -272,9 +256,8 @@ public interface Storage {
* @throws IllegalStateException if the track instance was not obtained from LuckPerms.
* @deprecated in favour of {@link TrackManager#saveTrack(Track)}
*/
- @NonNull
@Deprecated
- CompletableFuture saveTrack(@NonNull Track track);
+ @NonNull CompletableFuture saveTrack(@NonNull Track track);
/**
* Permanently deletes a track from storage
@@ -285,9 +268,8 @@ public interface Storage {
* @throws IllegalStateException if the track instance was not obtained from LuckPerms.
* @deprecated in favour of {@link TrackManager#deleteTrack(Track)}
*/
- @NonNull
@Deprecated
- CompletableFuture deleteTrack(@NonNull Track track);
+ @NonNull CompletableFuture deleteTrack(@NonNull Track track);
/**
* Saves UUID caching data to the global cache
@@ -299,8 +281,7 @@ public interface Storage {
* @throws IllegalArgumentException if the username is invalid
* @deprecated in favour of {@link UserManager#savePlayerData(UUID, String)}
*/
- @NonNull
- CompletableFuture saveUUIDData(@NonNull String username, @NonNull UUID uuid);
+ @NonNull CompletableFuture saveUUIDData(@NonNull String username, @NonNull UUID uuid);
/**
* Gets a UUID from a username
@@ -311,8 +292,7 @@ public interface Storage {
* @throws IllegalArgumentException if the username is invalid
* @deprecated in favour of {@link UserManager#lookupUuid(String)}
*/
- @NonNull
- CompletableFuture getUUID(@NonNull String username);
+ @NonNull CompletableFuture getUUID(@NonNull String username);
/**
* Gets a username from a UUID
@@ -323,9 +303,7 @@ public interface Storage {
* @since 2.17
* @deprecated in favour of {@link UserManager#lookupUsername(UUID)}
*/
- @NonNull
- @Deprecated
- CompletableFuture getName(@NonNull UUID uuid);
+ @NonNull @Deprecated CompletableFuture getName(@NonNull UUID uuid);
/**
* Returns an executor which will run all passed runnables on the
@@ -337,9 +315,7 @@ public interface Storage {
* @return an executor instance
* @deprecated as plugins should create their own executors
*/
- @NonNull
- @Deprecated
- Executor getSyncExecutor();
+ @NonNull @Deprecated Executor getSyncExecutor();
/**
* Returns an executor which will run all passed runnables asynchronously
@@ -351,8 +327,6 @@ public interface Storage {
* @return an executor instance
* @deprecated as plugins should create their own executors
*/
- @NonNull
- @Deprecated
- Executor getAsyncExecutor();
+ @NonNull @Deprecated Executor getAsyncExecutor();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/TemporaryDataMutateResult.java b/api/src/main/java/me/lucko/luckperms/api/TemporaryDataMutateResult.java
index 4bc3fc29..fa993830 100644
--- a/api/src/main/java/me/lucko/luckperms/api/TemporaryDataMutateResult.java
+++ b/api/src/main/java/me/lucko/luckperms/api/TemporaryDataMutateResult.java
@@ -39,8 +39,7 @@ public interface TemporaryDataMutateResult {
*
* @return the result
*/
- @NonNull
- DataMutateResult getResult();
+ @NonNull DataMutateResult getResult();
/**
* Gets the node that resulted from any {@link TemporaryMergeBehaviour}
@@ -51,7 +50,6 @@ public interface TemporaryDataMutateResult {
*
* @return the resultant node
*/
- @NonNull
- Node getMergedNode();
+ @NonNull Node getMergedNode();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/Track.java b/api/src/main/java/me/lucko/luckperms/api/Track.java
index 4fa3b919..9e2610a3 100644
--- a/api/src/main/java/me/lucko/luckperms/api/Track.java
+++ b/api/src/main/java/me/lucko/luckperms/api/Track.java
@@ -42,8 +42,7 @@ public interface Track {
*
* @return the name of this track
*/
- @NonNull
- String getName();
+ @NonNull String getName();
/**
* Gets a list of the groups on this track
@@ -54,8 +53,7 @@ public interface Track {
*
* @return an ordered {@link List} of the groups on this track
*/
- @NonNull
- List getGroups();
+ @NonNull List getGroups();
/**
* Gets the number of groups on this track
@@ -74,8 +72,7 @@ public interface Track {
* @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
*/
- @Nullable
- String getNext(@NonNull Group current);
+ @Nullable String getNext(@NonNull Group current);
/**
* Gets the previous group on the track, before the one provided
@@ -87,41 +84,37 @@ public interface Track {
* @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
*/
- @Nullable
- String getPrevious(@NonNull Group current);
+ @Nullable String getPrevious(@NonNull Group current);
/**
* Promotes the given user along this track.
*
- * @param user the user to promote
+ * @param user the user to promote
* @param contextSet the contexts to promote the user in
* @return the result of the action
* @since 4.2
*/
- @NonNull
- PromotionResult promote(@NonNull User user, @NonNull ContextSet contextSet);
+ @NonNull PromotionResult promote(@NonNull User user, @NonNull ContextSet contextSet);
/**
* Demotes the given user along this track.
*
- * @param user the user to demote
+ * @param user the user to demote
* @param contextSet the contexts to demote the user in
* @return the result of the action
* @since 4.2
*/
- @NonNull
- DemotionResult demote(@NonNull User user, @NonNull ContextSet contextSet);
+ @NonNull DemotionResult demote(@NonNull User user, @NonNull ContextSet contextSet);
/**
* Appends a group to the end of this track
*
* @param group the group to append
* @return the result of the operation
- * @throws NullPointerException if the group is null
- * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
+ * @throws NullPointerException if the group is null
+ * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
*/
- @NonNull
- DataMutateResult appendGroup(@NonNull Group group);
+ @NonNull DataMutateResult appendGroup(@NonNull Group group);
/**
* Inserts a group at a certain position on this track
@@ -133,8 +126,7 @@ public interface Track {
* @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
*/
- @NonNull
- DataMutateResult insertGroup(@NonNull Group group, int position) throws IndexOutOfBoundsException;
+ @NonNull DataMutateResult insertGroup(@NonNull Group group, int position) throws IndexOutOfBoundsException;
/**
* Removes a group from this track
@@ -144,8 +136,7 @@ public interface Track {
* @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
*/
- @NonNull
- DataMutateResult removeGroup(@NonNull Group group);
+ @NonNull DataMutateResult removeGroup(@NonNull Group group);
/**
* Removes a group from this track
@@ -154,8 +145,7 @@ public interface Track {
* @return the result of the operation
* @throws NullPointerException if the group is null
*/
- @NonNull
- DataMutateResult removeGroup(@NonNull String group);
+ @NonNull DataMutateResult removeGroup(@NonNull String group);
/**
* Checks if a group features on this track
diff --git a/api/src/main/java/me/lucko/luckperms/api/User.java b/api/src/main/java/me/lucko/luckperms/api/User.java
index daaa2f55..147e160e 100644
--- a/api/src/main/java/me/lucko/luckperms/api/User.java
+++ b/api/src/main/java/me/lucko/luckperms/api/User.java
@@ -42,8 +42,7 @@ public interface User extends PermissionHolder {
*
* @return the users Mojang assigned unique id
*/
- @NonNull
- UUID getUuid();
+ @NonNull UUID getUuid();
/**
* Gets the users username
@@ -52,8 +51,7 @@ public interface User extends PermissionHolder {
*
* @return the users username
*/
- @Nullable
- String getName();
+ @Nullable String getName();
/**
* Gets the users current primary group.
@@ -64,8 +62,7 @@ public interface User extends PermissionHolder {
*
* @return the users primary group
*/
- @NonNull
- String getPrimaryGroup();
+ @NonNull String getPrimaryGroup();
/**
* Sets a users primary group.
@@ -75,11 +72,10 @@ public interface User extends PermissionHolder {
*
* @param group the new primary group
* @return if the change was applied successfully
- * @throws IllegalStateException if the user is not a member of that group
- * @throws NullPointerException if the group is null
+ * @throws IllegalStateException if the user is not a member of that group
+ * @throws NullPointerException if the group is null
*/
- @NonNull
- DataMutateResult setPrimaryGroup(@NonNull String group);
+ @NonNull DataMutateResult setPrimaryGroup(@NonNull String group);
/**
* Gets the user's {@link UserData} cache.
@@ -87,16 +83,15 @@ public interface User extends PermissionHolder {
* @return the users cached data.
* @since 3.2
*/
- @NonNull
@Override
- UserData getCachedData();
+ @NonNull UserData getCachedData();
/**
* Refresh and re-assign the users permissions.
*
* @deprecated Calling this method is no longer necessary. Permissions data is now refreshed on
- * demand, as changes are made. Consider use of {@link #refreshCachedData()}
- * instead. This method is now implemented as a no-op.
+ * demand, as changes are made. Consider use of {@link #refreshCachedData()}
+ * instead. This method is now implemented as a no-op.
*/
@Deprecated
void refreshPermissions();
diff --git a/api/src/main/java/me/lucko/luckperms/api/UuidCache.java b/api/src/main/java/me/lucko/luckperms/api/UuidCache.java
index afddb5b0..6b2e583a 100644
--- a/api/src/main/java/me/lucko/luckperms/api/UuidCache.java
+++ b/api/src/main/java/me/lucko/luckperms/api/UuidCache.java
@@ -34,7 +34,7 @@ import java.util.UUID;
* LuckPerms UUIDs.
*
* @deprecated this feature is now handled internally - and the API returns a
- * No-op implementation of this class.
+ * No-op implementation of this class.
*/
@Deprecated
public interface UuidCache {
@@ -50,9 +50,8 @@ public interface UuidCache {
* ProxiedPlayer#getUniqueId
* @return the corresponding internal UUID
*/
- @NonNull
@Deprecated
- UUID getUUID(@NonNull UUID mojangUuid);
+ @NonNull UUID getUUID(@NonNull UUID mojangUuid);
/**
* Gets a users "external", server assigned unique id, from the internal
@@ -62,8 +61,7 @@ public interface UuidCache {
* User#getUuid
* @return the corresponding external UUID
*/
- @NonNull
@Deprecated
- UUID getExternalUUID(@NonNull UUID internalUuid);
+ @NonNull UUID getExternalUUID(@NonNull UUID internalUuid);
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/CachedData.java b/api/src/main/java/me/lucko/luckperms/api/caching/CachedData.java
index 67d39806..ad101df0 100644
--- a/api/src/main/java/me/lucko/luckperms/api/caching/CachedData.java
+++ b/api/src/main/java/me/lucko/luckperms/api/caching/CachedData.java
@@ -57,8 +57,7 @@ public interface CachedData {
* @return a permission data instance
* @throws NullPointerException if contexts is null
*/
- @NonNull
- PermissionData getPermissionData(@NonNull Contexts contexts);
+ @NonNull PermissionData getPermissionData(@NonNull Contexts contexts);
/**
* Gets MetaData from the cache, given a specified context.
@@ -68,8 +67,7 @@ public interface CachedData {
* @throws NullPointerException if contexts is null
* @since 3.2
*/
- @NonNull
- MetaData getMetaData(@NonNull MetaContexts contexts);
+ @NonNull MetaData getMetaData(@NonNull MetaContexts contexts);
/**
* Gets MetaData from the cache, given a specified context.
@@ -78,8 +76,7 @@ public interface CachedData {
* @return a meta data instance
* @throws NullPointerException if contexts is null
*/
- @NonNull
- MetaData getMetaData(@NonNull Contexts contexts);
+ @NonNull MetaData getMetaData(@NonNull Contexts contexts);
/**
* Calculates permission data, bypassing the cache.
@@ -96,8 +93,7 @@ public interface CachedData {
* @return a permission data instance
* @throws NullPointerException if contexts is null
*/
- @NonNull
- PermissionData calculatePermissions(@NonNull Contexts contexts);
+ @NonNull PermissionData calculatePermissions(@NonNull Contexts contexts);
/**
* Calculates meta data, bypassing the cache.
@@ -115,8 +111,7 @@ public interface CachedData {
* @throws NullPointerException if contexts is null
* @since 3.2
*/
- @NonNull
- MetaData calculateMeta(@NonNull MetaContexts contexts);
+ @NonNull MetaData calculateMeta(@NonNull MetaContexts contexts);
/**
* Calculates meta data, bypassing the cache.
@@ -133,8 +128,7 @@ public interface CachedData {
* @return a meta data instance
* @throws NullPointerException if contexts is null
*/
- @NonNull
- MetaData calculateMeta(@NonNull Contexts contexts);
+ @NonNull MetaData calculateMeta(@NonNull Contexts contexts);
/**
* (Re)calculates permission data for a given context.
@@ -212,12 +206,11 @@ public interface CachedData {
* until the recalculation has been performed.
*
* @param contexts the contexts to reload in.
- * @throws NullPointerException if contexts is null
* @return a future
+ * @throws NullPointerException if contexts is null
* @since 4.0
*/
- @NonNull
- CompletableFuture extends PermissionData> reloadPermissions(@NonNull Contexts contexts);
+ @NonNull CompletableFuture extends PermissionData> reloadPermissions(@NonNull Contexts contexts);
/**
* (Re)loads meta data for a given context.
@@ -240,12 +233,11 @@ public interface CachedData {
* until the recalculation has been performed.
*
* @param contexts the contexts to reload in.
- * @throws NullPointerException if contexts is null
* @return a future
+ * @throws NullPointerException if contexts is null
* @since 4.0
*/
- @NonNull
- CompletableFuture extends MetaData> reloadMeta(@NonNull MetaContexts contexts);
+ @NonNull CompletableFuture extends MetaData> reloadMeta(@NonNull MetaContexts contexts);
/**
* (Re)loads meta data for a given context.
@@ -268,12 +260,11 @@ public interface CachedData {
* until the recalculation has been performed.
*
* @param contexts the contexts to reload in.
- * @throws NullPointerException if contexts is null
* @return a future
+ * @throws NullPointerException if contexts is null
* @since 4.0
*/
- @NonNull
- CompletableFuture extends MetaData> reloadMeta(@NonNull Contexts contexts);
+ @NonNull CompletableFuture extends MetaData> reloadMeta(@NonNull Contexts contexts);
/**
* Recalculates permission data for all known contexts.
@@ -318,8 +309,7 @@ public interface CachedData {
* @return a future
* @since 4.0
*/
- @NonNull
- CompletableFuture reloadPermissions();
+ @NonNull CompletableFuture reloadPermissions();
/**
* Reloads meta data for all known contexts.
@@ -342,8 +332,7 @@ public interface CachedData {
* @return a future
* @since 4.0
*/
- @NonNull
- CompletableFuture reloadMeta();
+ @NonNull CompletableFuture reloadMeta();
/**
* Pre-calculates and caches {@link PermissionData} and {@link MetaData}
diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/CachedDataContainer.java b/api/src/main/java/me/lucko/luckperms/api/caching/CachedDataContainer.java
index caa80cdb..d9aa4b04 100644
--- a/api/src/main/java/me/lucko/luckperms/api/caching/CachedDataContainer.java
+++ b/api/src/main/java/me/lucko/luckperms/api/caching/CachedDataContainer.java
@@ -41,7 +41,6 @@ public interface CachedDataContainer {
*
* @return the contexts this container is caching
*/
- @NonNull
- Contexts getContexts();
+ @NonNull Contexts getContexts();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/MetaContexts.java b/api/src/main/java/me/lucko/luckperms/api/caching/MetaContexts.java
index 4550a9e4..1c30a46a 100644
--- a/api/src/main/java/me/lucko/luckperms/api/caching/MetaContexts.java
+++ b/api/src/main/java/me/lucko/luckperms/api/caching/MetaContexts.java
@@ -45,7 +45,7 @@ public final class MetaContexts {
/**
* Creates a new meta contexts instance
*
- * @param contexts the standard contexts for the query
+ * @param contexts the standard contexts for the query
* @param prefixStackDefinition the prefix stack definition to be used
* @param suffixStackDefinition the suffix stack definition to be used
* @return the new instance
@@ -64,7 +64,7 @@ public final class MetaContexts {
/**
* Creates a new meta contexts instance
*
- * @param contexts the standard contexts for the query
+ * @param contexts the standard contexts for the query
* @param prefixStackDefinition the prefix stack definition to be used
* @param suffixStackDefinition the suffix stack definition to be used
*/
diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/MetaData.java b/api/src/main/java/me/lucko/luckperms/api/caching/MetaData.java
index 78eb9818..ead912ad 100644
--- a/api/src/main/java/me/lucko/luckperms/api/caching/MetaData.java
+++ b/api/src/main/java/me/lucko/luckperms/api/caching/MetaData.java
@@ -47,8 +47,7 @@ public interface MetaData extends CachedDataContainer {
*
* @return the contexts this container is caching
*/
- @NonNull
- MetaContexts getMetaContexts();
+ @NonNull MetaContexts getMetaContexts();
/**
* Gets an immutable copy of the meta this user has.
@@ -62,8 +61,7 @@ public interface MetaData extends CachedDataContainer {
* @return an immutable multimap of meta
* @since 3.3
*/
- @NonNull
- ListMultimap getMetaMultimap();
+ @NonNull ListMultimap getMetaMultimap();
/**
* Gets an immutable copy of the meta this user has.
@@ -73,8 +71,7 @@ public interface MetaData extends CachedDataContainer {
*
* @return an immutable map of meta
*/
- @NonNull
- Map getMeta();
+ @NonNull Map getMeta();
/**
* Gets an immutable sorted map of all of the prefixes the user has, whereby the first value is the highest priority
@@ -82,8 +79,7 @@ public interface MetaData extends CachedDataContainer {
*
* @return a sorted map of prefixes
*/
- @NonNull
- SortedMap getPrefixes();
+ @NonNull SortedMap getPrefixes();
/**
* Gets an immutable sorted map of all of the suffixes the user has, whereby the first value is the highest priority
@@ -91,24 +87,21 @@ public interface MetaData extends CachedDataContainer {
*
* @return a sorted map of suffixes
*/
- @NonNull
- SortedMap getSuffixes();
+ @NonNull SortedMap getSuffixes();
/**
* Gets the user's highest priority prefix, or null if the user has no prefixes
*
* @return a prefix string, or null
*/
- @Nullable
- String getPrefix();
+ @Nullable String getPrefix();
/**
* Gets the user's highest priority suffix, or null if the user has no suffixes
*
* @return a suffix string, or null
*/
- @Nullable
- String getSuffix();
+ @Nullable String getSuffix();
/**
* Gets the definition used for the prefix stack
@@ -116,8 +109,7 @@ public interface MetaData extends CachedDataContainer {
* @return the definition used for the prefix stack
* @since 3.2
*/
- @NonNull
- MetaStackDefinition getPrefixStackDefinition();
+ @NonNull MetaStackDefinition getPrefixStackDefinition();
/**
* Gets the definition used for the suffix stack
@@ -125,7 +117,6 @@ public interface MetaData extends CachedDataContainer {
* @return the definition used for the suffix stack
* @since 3.2
*/
- @NonNull
- MetaStackDefinition getSuffixStackDefinition();
+ @NonNull MetaStackDefinition getSuffixStackDefinition();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java b/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java
index e4fe7706..ac1460de 100644
--- a/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java
+++ b/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java
@@ -45,8 +45,7 @@ public interface PermissionData extends CachedDataContainer {
* @return a tristate result
* @throws NullPointerException if permission is null
*/
- @NonNull
- Tristate getPermissionValue(@NonNull String permission);
+ @NonNull Tristate getPermissionValue(@NonNull String permission);
/**
* Invalidates the underlying permission calculator cache.
@@ -60,7 +59,6 @@ public interface PermissionData extends CachedDataContainer {
*
* @return an immutable set of permissions
*/
- @NonNull
- Map getImmutableBacking();
+ @NonNull Map getImmutableBacking();
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java b/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java
index b6f22ac6..ec7b6179 100644
--- a/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java
+++ b/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java
@@ -44,7 +44,6 @@ public interface ContextCalculator {
* @return the map
* @since 2.13
*/
- @NonNull
- MutableContextSet giveApplicableContext(@NonNull T subject, @NonNull MutableContextSet accumulator);
+ @NonNull MutableContextSet giveApplicableContext(@NonNull T subject, @NonNull MutableContextSet accumulator);
}
diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ContextManager.java b/api/src/main/java/me/lucko/luckperms/api/context/ContextManager.java
index ff1fd4c5..558c6076 100644
--- a/api/src/main/java/me/lucko/luckperms/api/context/ContextManager.java
+++ b/api/src/main/java/me/lucko/luckperms/api/context/ContextManager.java
@@ -44,9 +44,9 @@ import java.util.Optional;
*
*
*
*
* @since 4.0
@@ -59,8 +59,7 @@ public interface ContextManager {
* @param subject the subject
* @return the applicable context for the subject
*/
- @NonNull
- ImmutableContextSet getApplicableContext(@NonNull Object subject);
+ @NonNull ImmutableContextSet getApplicableContext(@NonNull Object subject);
/**
* Queries the ContextManager for current context values for the subject.
@@ -68,8 +67,7 @@ public interface ContextManager {
* @param subject the subject
* @return the applicable context for the subject
*/
- @NonNull
- Contexts getApplicableContexts(@NonNull Object subject);
+ @NonNull Contexts getApplicableContexts(@NonNull Object subject);
/**
* Queries the ContextManager for current context values for the given User.
@@ -83,8 +81,7 @@ public interface ContextManager {
* @param user the user
* @return the applicable context for the subject
*/
- @NonNull
- Optional lookupApplicableContext(@NonNull User user);
+ @NonNull Optional lookupApplicableContext(@NonNull User user);
/**
* Queries the ContextManager for current context values for the given User.
@@ -98,8 +95,7 @@ public interface ContextManager {
* @param user the user
* @return the applicable context for the subject
*/
- @NonNull
- Optional lookupApplicableContexts(@NonNull User user);
+ @NonNull Optional lookupApplicableContexts(@NonNull User user);
/**
* Gets the contexts from the static calculators in this manager.
@@ -109,8 +105,7 @@ public interface ContextManager {
*
* @return the current active static contexts
*/
- @NonNull
- ImmutableContextSet getStaticContext();
+ @NonNull ImmutableContextSet getStaticContext();
/**
* Gets the contexts from the static calculators in this manager.
@@ -120,8 +115,7 @@ public interface ContextManager {
*
* @return the current active static contexts
*/
- @NonNull
- Contexts getStaticContexts();
+ @NonNull Contexts getStaticContexts();
/**
* Forms a {@link Contexts} instance from an {@link ImmutableContextSet}.
@@ -129,12 +123,11 @@ public interface ContextManager {
*
This method relies on the plugins configuration to form the
* {@link Contexts} instance.
*
- * @param subject the reference subject
+ * @param subject the reference subject
* @param contextSet the context set
* @return a contexts instance
*/
- @NonNull
- Contexts formContexts(@NonNull Object subject, @NonNull ImmutableContextSet contextSet);
+ @NonNull Contexts formContexts(@NonNull Object subject, @NonNull ImmutableContextSet contextSet);
/**
* Forms a {@link Contexts} instance from an {@link ImmutableContextSet}.
@@ -145,8 +138,7 @@ public interface ContextManager {
* @param contextSet the context set
* @return a contexts instance
*/
- @NonNull
- Contexts formContexts(@NonNull ImmutableContextSet contextSet);
+ @NonNull Contexts formContexts(@NonNull ImmutableContextSet contextSet);
/**
* Registers a context calculator with the manager.
diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java b/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java
index da78a149..81f3fd8b 100644
--- a/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java
+++ b/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java
@@ -78,9 +78,9 @@ public interface ContextSet extends Iterable> {
/**
* Creates an {@link ImmutableContextSet} from two context pairs.
*
- * @param key1 the first key
+ * @param key1 the first key
* @param value1 the first value
- * @param key2 the second key
+ * @param key2 the second key
* @param value2 the second value
* @return a new ImmutableContextSet containing the two pairs
* @throws NullPointerException if any of the keys or values are null
@@ -163,8 +163,7 @@ public interface ContextSet extends Iterable> {
*
* @return an immutable representation of this set
*/
- @NonNull
- ImmutableContextSet makeImmutable();
+ @NonNull ImmutableContextSet makeImmutable();
/**
* Creates a mutable copy of this {@link ContextSet}.
@@ -175,8 +174,7 @@ public interface ContextSet extends Iterable> {
* @return a mutable ContextSet
* @since 2.16
*/
- @NonNull
- MutableContextSet mutableCopy();
+ @NonNull MutableContextSet mutableCopy();
/**
* Returns a {@link Set} of {@link Map.Entry}s representing the current
@@ -187,8 +185,7 @@ public interface ContextSet extends Iterable> {
*
* @return an immutable set
*/
- @NonNull
- Set> toSet();
+ @NonNull Set> toSet();
/**
* Returns a {@link Map} loosely representing the current state of
@@ -207,9 +204,8 @@ public interface ContextSet extends Iterable> {
* @return an immutable map
* @deprecated because the resultant map may not contain all data in the ContextSet
*/
- @NonNull
@Deprecated
- Map toMap();
+ @NonNull Map toMap();
/**
* Returns a {@link Multimap} representing the current state of this
@@ -221,8 +217,7 @@ public interface ContextSet extends Iterable> {
* @return a multimap
* @since 2.16
*/
- @NonNull
- Multimap toMultimap();
+ @NonNull Multimap toMultimap();
/**
* Returns an {@link Iterator} over each of the context pairs in this set.
@@ -234,9 +229,8 @@ public interface ContextSet extends Iterable> {
*
* @return an iterator
*/
- @NonNull
@Override
- Iterator> iterator();
+ @NonNull Iterator> iterator();
/**
* Returns if the {@link ContextSet} contains at least one value for the
@@ -258,8 +252,7 @@ public interface ContextSet extends Iterable> {
* @return a set of values
* @throws NullPointerException if the key is null
*/
- @NonNull
- Set getValues(@NonNull String key);
+ @NonNull Set getValues(@NonNull String key);
/**
* Returns any value from this {@link ContextSet} matching the key, if present.
diff --git a/api/src/main/java/me/lucko/luckperms/api/context/StaticContextCalculator.java b/api/src/main/java/me/lucko/luckperms/api/context/StaticContextCalculator.java
index 1160f2c6..de4fb8a9 100644
--- a/api/src/main/java/me/lucko/luckperms/api/context/StaticContextCalculator.java
+++ b/api/src/main/java/me/lucko/luckperms/api/context/StaticContextCalculator.java
@@ -43,13 +43,12 @@ public interface StaticContextCalculator extends ContextCalculator