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 getPermissions(); + @NonNull SortedSet 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 getEnduringPermissions(); + @NonNull Set 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 getTransientPermissions(); + @NonNull Set 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 reloadPermissions(@NonNull Contexts contexts); + @NonNull CompletableFuture 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 reloadMeta(@NonNull MetaContexts contexts); + @NonNull CompletableFuture 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 reloadMeta(@NonNull Contexts contexts); + @NonNull CompletableFuture 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; * *

*
    - *
  • {@code org.bukkit.entity.Player}
  • - *
  • {@code net.md_5.bungee.api.connection.ProxiedPlayer}
  • - *
  • {@code org.spongepowered.api.service.permission.Subject}
  • + *
  • {@code org.bukkit.entity.Player}
  • + *
  • {@code net.md_5.bungee.api.connection.ProxiedPlayer}
  • + *
  • {@code org.spongepowered.api.service.permission.Subject}
  • *
* * @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 { * @param accumulator a map of contexts to add to * @return the map */ - @NonNull - MutableContextSet giveApplicableContext(@NonNull MutableContextSet accumulator); + @NonNull MutableContextSet giveApplicableContext(@NonNull MutableContextSet accumulator); /** * Gives the subject all of the applicable contexts they meet * - * @param subject the subject to add contexts to + * @param subject the subject to add contexts to * @param accumulator a map of contexts to add to * @return the map */ diff --git a/api/src/main/java/me/lucko/luckperms/api/event/Cancellable.java b/api/src/main/java/me/lucko/luckperms/api/event/Cancellable.java index 112168ae..a63e8e4a 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/Cancellable.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/Cancellable.java @@ -39,9 +39,7 @@ public interface Cancellable { * * @return the cancellation */ - @NonNull - @Param(-1) - AtomicBoolean getCancellationState(); + @NonNull @Param(-1) AtomicBoolean getCancellationState(); /** * Returns true if the event is currently cancelled. diff --git a/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java b/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java index ad051197..0dffe5fe 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java @@ -51,8 +51,7 @@ public interface EventBus { * @param the event class * @return an event handler instance representing this subscription */ - @NonNull - EventHandler subscribe(@NonNull Class eventClass, @NonNull Consumer handler); + @NonNull EventHandler subscribe(@NonNull Class eventClass, @NonNull Consumer handler); /** * Registers a new subscription to the given event. @@ -72,8 +71,7 @@ public interface EventBus { * @param handler the event handler * @return an event handler instance representing this subscription */ - @NonNull - EventHandler subscribe(Object plugin, @NonNull Class eventClass, @NonNull Consumer handler); + @NonNull EventHandler subscribe(Object plugin, @NonNull Class eventClass, @NonNull Consumer handler); /** * Gets a set of all registered handlers for a given event. @@ -82,7 +80,6 @@ public interface EventBus { * @param the event class * @return an immutable set of event handlers */ - @NonNull - Set> getHandlers(@NonNull Class eventClass); + @NonNull Set> getHandlers(@NonNull Class eventClass); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/EventHandler.java b/api/src/main/java/me/lucko/luckperms/api/event/EventHandler.java index e84aad97..4b77721a 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/EventHandler.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/EventHandler.java @@ -41,8 +41,7 @@ public interface EventHandler extends AutoCloseable { * * @return the event class */ - @NonNull - Class getEventClass(); + @NonNull Class getEventClass(); /** * Returns true if this handler is active @@ -63,8 +62,7 @@ public interface EventHandler extends AutoCloseable { * * @return the event consumer */ - @NonNull - Consumer getConsumer(); + @NonNull Consumer getConsumer(); /** * Gets the number of times this handler has been called diff --git a/api/src/main/java/me/lucko/luckperms/api/event/LuckPermsEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/LuckPermsEvent.java index cd8ec427..662050a4 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/LuckPermsEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/LuckPermsEvent.java @@ -41,7 +41,6 @@ public interface LuckPermsEvent { * * @return the api instance */ - @NonNull - LuckPermsApi getApi(); + @NonNull LuckPermsApi getApi(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/Sourced.java b/api/src/main/java/me/lucko/luckperms/api/event/Sourced.java index 5c179f95..92116736 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/Sourced.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/Sourced.java @@ -44,8 +44,6 @@ public interface Sourced { * * @return the source */ - @NonNull - @Param(-1) - Source getSource(); + @NonNull @Param(-1) Source getSource(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCacheLoadEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCacheLoadEvent.java index 8168413b..e4055736 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCacheLoadEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCacheLoadEvent.java @@ -44,17 +44,13 @@ public interface GroupCacheLoadEvent extends LuckPermsEvent { * * @return the group */ - @NonNull - @Param(0) - Group getGroup(); + @NonNull @Param(0) Group getGroup(); /** * Gets the data that was loaded * * @return the loaded data */ - @NonNull - @Param(1) - GroupData getLoadedData(); + @NonNull @Param(1) GroupData getLoadedData(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCreateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCreateEvent.java index 0a6bb860..11015d2f 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCreateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupCreateEvent.java @@ -42,17 +42,13 @@ public interface GroupCreateEvent extends LuckPermsEvent { * * @return the new group */ - @NonNull - @Param(0) - Group getGroup(); + @NonNull @Param(0) Group getGroup(); /** * Gets the cause of the creation * * @return the cause of the creation */ - @NonNull - @Param(1) - CreationCause getCause(); + @NonNull @Param(1) CreationCause getCause(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDataRecalculateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDataRecalculateEvent.java index 628e0661..f402f2d7 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDataRecalculateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDataRecalculateEvent.java @@ -44,17 +44,13 @@ public interface GroupDataRecalculateEvent extends LuckPermsEvent { * * @return the group */ - @NonNull - @Param(0) - Group getGroup(); + @NonNull @Param(0) Group getGroup(); /** * Gets the data that was recalculated * * @return the data */ - @NonNull - @Param(1) - GroupData getData(); + @NonNull @Param(1) GroupData getData(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDeleteEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDeleteEvent.java index 9c129402..2f99dee7 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDeleteEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupDeleteEvent.java @@ -44,26 +44,20 @@ public interface GroupDeleteEvent extends LuckPermsEvent { * * @return the name of the deleted group */ - @NonNull - @Param(0) - String getGroupName(); + @NonNull @Param(0) String getGroupName(); /** * Gets an immutable copy of the groups existing data * * @return a copy of the groups existing data */ - @NonNull - @Param(1) - Set getExistingData(); + @NonNull @Param(1) Set getExistingData(); /** * Gets the cause of the deletion * * @return the cause of the deletion */ - @NonNull - @Param(2) - DeletionCause getCause(); + @NonNull @Param(2) DeletionCause getCause(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupLoadEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupLoadEvent.java index 975f2e95..5a70d933 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/group/GroupLoadEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/group/GroupLoadEvent.java @@ -43,8 +43,6 @@ public interface GroupLoadEvent extends LuckPermsEvent { * * @return the group that was loaded */ - @NonNull - @Param(0) - Group getGroup(); + @NonNull @Param(0) Group getGroup(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/log/LogBroadcastEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/log/LogBroadcastEvent.java index 7c34bb62..10b1838a 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/log/LogBroadcastEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/log/LogBroadcastEvent.java @@ -42,9 +42,7 @@ public interface LogBroadcastEvent extends LuckPermsEvent, Cancellable { * * @return the log entry to be broadcasted */ - @NonNull - @Param(0) - LogEntry getEntry(); + @NonNull @Param(0) LogEntry getEntry(); /** * Gets where the log entry originated from. @@ -52,9 +50,7 @@ public interface LogBroadcastEvent extends LuckPermsEvent, Cancellable { * @return the origin of the log * @since 3.3 */ - @NonNull - @Param(1) - Origin getOrigin(); + @NonNull @Param(1) Origin getOrigin(); /** * Represents where a log entry is from diff --git a/api/src/main/java/me/lucko/luckperms/api/event/log/LogNetworkPublishEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/log/LogNetworkPublishEvent.java index d2db4d43..54beca9e 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/log/LogNetworkPublishEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/log/LogNetworkPublishEvent.java @@ -46,17 +46,13 @@ public interface LogNetworkPublishEvent extends LuckPermsEvent, Cancellable { * * @return the id of the log entry being published */ - @NonNull - @Param(0) - UUID getLogId(); + @NonNull @Param(0) UUID getLogId(); /** * Gets the log entry to be published * * @return the log entry to be published */ - @NonNull - @Param(1) - LogEntry getEntry(); + @NonNull @Param(1) LogEntry getEntry(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/log/LogNotifyEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/log/LogNotifyEvent.java index c0350046..10ebcda0 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/log/LogNotifyEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/log/LogNotifyEvent.java @@ -50,27 +50,21 @@ public interface LogNotifyEvent extends LuckPermsEvent, Cancellable { * * @return the log entry to be sent */ - @NonNull - @Param(0) - LogEntry getEntry(); + @NonNull @Param(0) LogEntry getEntry(); /** * Gets where the log entry originated from. * * @return the origin of the log */ - @NonNull - @Param(1) - Origin getOrigin(); + @NonNull @Param(1) Origin getOrigin(); /** * Gets the object to be notified. * * @return the object to notify */ - @NonNull - @Param(2) - Entity getNotifiable(); + @NonNull @Param(2) Entity getNotifiable(); /** * Represents where a log entry is from diff --git a/api/src/main/java/me/lucko/luckperms/api/event/log/LogPublishEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/log/LogPublishEvent.java index 2751333a..dd777ca2 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/log/LogPublishEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/log/LogPublishEvent.java @@ -42,8 +42,6 @@ public interface LogPublishEvent extends LuckPermsEvent, Cancellable { * * @return the log entry to be published */ - @NonNull - @Param(0) - LogEntry getEntry(); + @NonNull @Param(0) LogEntry getEntry(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/log/LogReceiveEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/log/LogReceiveEvent.java index c3b8350d..a29bb9ac 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/log/LogReceiveEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/log/LogReceiveEvent.java @@ -45,17 +45,13 @@ public interface LogReceiveEvent extends LuckPermsEvent { * * @return the id of the log entry being received */ - @NonNull - @Param(0) - UUID getLogId(); + @NonNull @Param(0) UUID getLogId(); /** * Gets the log entry being received * * @return the log entry being received */ - @NonNull - @Param(1) - LogEntry getEntry(); + @NonNull @Param(1) LogEntry getEntry(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeAddEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeAddEvent.java index 881e8238..23f0df5a 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeAddEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeAddEvent.java @@ -40,8 +40,6 @@ public interface NodeAddEvent extends NodeMutateEvent { * * @return the node that was added */ - @NonNull - @Param(3) - Node getNode(); + @NonNull @Param(3) Node getNode(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeMutateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeMutateEvent.java index da6e4b43..de4f4975 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeMutateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeMutateEvent.java @@ -46,27 +46,21 @@ public interface NodeMutateEvent extends LuckPermsEvent { * * @return the event target */ - @NonNull - @Param(0) - PermissionHolder getTarget(); + @NonNull @Param(0) PermissionHolder getTarget(); /** * Gets an immutable copy of the holders data before the change * * @return the data before the change */ - @NonNull - @Param(1) - Set getDataBefore(); + @NonNull @Param(1) Set getDataBefore(); /** * Gets an immutable copy of the holders data after the change * * @return the data after the change */ - @NonNull - @Param(2) - Set getDataAfter(); + @NonNull @Param(2) Set getDataAfter(); /** * Gets whether the target of this event is a {@link me.lucko.luckperms.api.User} diff --git a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeRemoveEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeRemoveEvent.java index 9a4fe96b..62222e3c 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/node/NodeRemoveEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/node/NodeRemoveEvent.java @@ -40,8 +40,6 @@ public interface NodeRemoveEvent extends NodeMutateEvent { * * @return the node that was removed */ - @NonNull - @Param(3) - Node getNode(); + @NonNull @Param(3) Node getNode(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/player/PlayerDataSaveEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/player/PlayerDataSaveEvent.java index ea5d4673..af0a0323 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/player/PlayerDataSaveEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/player/PlayerDataSaveEvent.java @@ -48,26 +48,20 @@ public interface PlayerDataSaveEvent extends LuckPermsEvent { * * @return the uuid */ - @NonNull - @Param(0) - UUID getUuid(); + @NonNull @Param(0) UUID getUuid(); /** * Gets the username that was saved. * * @return the username */ - @NonNull - @Param(1) - String getUsername(); + @NonNull @Param(1) String getUsername(); /** * Gets the result of the operation. * * @return the result */ - @NonNull - @Param(2) - PlayerSaveResult getResult(); + @NonNull @Param(2) PlayerSaveResult getResult(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/source/EntitySource.java b/api/src/main/java/me/lucko/luckperms/api/event/source/EntitySource.java index 071a10d0..d319a3ba 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/source/EntitySource.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/source/EntitySource.java @@ -41,7 +41,6 @@ public interface EntitySource extends Source { * * @return the entity */ - @NonNull - Entity getEntity(); + @NonNull Entity getEntity(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/source/Source.java b/api/src/main/java/me/lucko/luckperms/api/event/source/Source.java index 86143db0..77456e10 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/source/Source.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/source/Source.java @@ -43,8 +43,7 @@ public interface Source { * * @return the type */ - @NonNull - Type getType(); + @NonNull Type getType(); /** * Represents a type of source diff --git a/api/src/main/java/me/lucko/luckperms/api/event/sync/PreNetworkSyncEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/sync/PreNetworkSyncEvent.java index a23aaa6e..dab6487f 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/sync/PreNetworkSyncEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/sync/PreNetworkSyncEvent.java @@ -43,8 +43,6 @@ public interface PreNetworkSyncEvent extends LuckPermsEvent, Cancellable { * * @return the id of the sync request */ - @NonNull - @Param(0) - UUID getSyncId(); + @NonNull @Param(0) UUID getSyncId(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackCreateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackCreateEvent.java index bbc5a0ab..77e7b522 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackCreateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackCreateEvent.java @@ -42,17 +42,13 @@ public interface TrackCreateEvent extends LuckPermsEvent { * * @return the new track */ - @NonNull - @Param(0) - Track getTrack(); + @NonNull @Param(0) Track getTrack(); /** * Gets the cause of the creation * * @return the cause of the creation */ - @NonNull - @Param(1) - CreationCause getCause(); + @NonNull @Param(1) CreationCause getCause(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackDeleteEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackDeleteEvent.java index e9c3a4f7..10d7fb82 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackDeleteEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackDeleteEvent.java @@ -43,26 +43,20 @@ public interface TrackDeleteEvent extends LuckPermsEvent { * * @return the name of the deleted track */ - @NonNull - @Param(0) - String getTrackName(); + @NonNull @Param(0) String getTrackName(); /** * Gets an immutable copy of the tracks existing data * * @return a copy of the tracks existing data */ - @NonNull - @Param(1) - List getExistingData(); + @NonNull @Param(1) List getExistingData(); /** * Gets the cause of the deletion * * @return the cause of the deletion */ - @NonNull - @Param(2) - DeletionCause getCause(); + @NonNull @Param(2) DeletionCause getCause(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackLoadEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackLoadEvent.java index 3e38d3b4..3b926f21 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/TrackLoadEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/TrackLoadEvent.java @@ -43,8 +43,6 @@ public interface TrackLoadEvent extends LuckPermsEvent { * * @return the track that was loaded */ - @NonNull - @Param(0) - Track getTrack(); + @NonNull @Param(0) Track getTrack(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackAddGroupEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackAddGroupEvent.java index b69e9eea..cbd54ca8 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackAddGroupEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackAddGroupEvent.java @@ -39,8 +39,6 @@ public interface TrackAddGroupEvent extends TrackMutateEvent { * * @return the group that was added */ - @NonNull - @Param(3) - String getGroup(); + @NonNull @Param(3) String getGroup(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackMutateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackMutateEvent.java index 516c50bc..9999bb80 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackMutateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackMutateEvent.java @@ -43,26 +43,20 @@ public interface TrackMutateEvent extends LuckPermsEvent { * * @return the track that was mutated */ - @NonNull - @Param(0) - Track getTrack(); + @NonNull @Param(0) Track getTrack(); /** * Gets an immutable copy of the tracks data before the change * * @return the data before the change */ - @NonNull - @Param(1) - List getDataBefore(); + @NonNull @Param(1) List getDataBefore(); /** * Gets an immutable copy of the tracks data after the change * * @return the data after the change */ - @NonNull - @Param(2) - List getDataAfter(); + @NonNull @Param(2) List getDataAfter(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackRemoveGroupEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackRemoveGroupEvent.java index abe2d239..10d061aa 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackRemoveGroupEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/track/mutate/TrackRemoveGroupEvent.java @@ -39,8 +39,6 @@ public interface TrackRemoveGroupEvent extends TrackMutateEvent { * * @return the group that was removed */ - @NonNull - @Param(3) - String getGroup(); + @NonNull @Param(3) String getGroup(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/UserCacheLoadEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/UserCacheLoadEvent.java index 5d3370c9..a2cf8092 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/UserCacheLoadEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/UserCacheLoadEvent.java @@ -42,17 +42,13 @@ public interface UserCacheLoadEvent extends LuckPermsEvent { * * @return the user */ - @NonNull - @Param(0) - User getUser(); + @NonNull @Param(0) User getUser(); /** * Gets the data that was loaded * * @return the loaded data */ - @NonNull - @Param(1) - UserData getLoadedData(); + @NonNull @Param(1) UserData getLoadedData(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/UserDataRecalculateEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/UserDataRecalculateEvent.java index 7dba5f82..7067ae4b 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/UserDataRecalculateEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/UserDataRecalculateEvent.java @@ -42,17 +42,13 @@ public interface UserDataRecalculateEvent extends LuckPermsEvent { * * @return the user */ - @NonNull - @Param(0) - User getUser(); + @NonNull @Param(0) User getUser(); /** * Gets the data that was recalculated * * @return the data */ - @NonNull - @Param(1) - UserData getData(); + @NonNull @Param(1) UserData getData(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/UserFirstLoginEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/UserFirstLoginEvent.java index d1cbe3dd..e7eae3b5 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/UserFirstLoginEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/UserFirstLoginEvent.java @@ -50,17 +50,13 @@ public interface UserFirstLoginEvent extends LuckPermsEvent { * * @return the uuid of the user */ - @NonNull - @Param(0) - UUID getUuid(); + @NonNull @Param(0) UUID getUuid(); /** * Gets the username of the user * * @return the username of the user */ - @NonNull - @Param(1) - String getUsername(); + @NonNull @Param(1) String getUsername(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoadEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoadEvent.java index 1338b64b..3a9d81e6 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoadEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoadEvent.java @@ -41,8 +41,6 @@ public interface UserLoadEvent extends LuckPermsEvent { * * @return the user that was loaded */ - @NonNull - @Param(0) - User getUser(); + @NonNull @Param(0) User getUser(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoginProcessEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoginProcessEvent.java index fa27dab8..53efaaa2 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoginProcessEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/UserLoginProcessEvent.java @@ -52,26 +52,20 @@ public interface UserLoginProcessEvent extends LuckPermsEvent { * * @return the uuid of the connection which was processed */ - @NonNull - @Param(0) - UUID getUuid(); + @NonNull @Param(0) UUID getUuid(); /** * Gets the username of the connection which was processed * * @return the username of the connection which was processed */ - @NonNull - @Param(1) - String getUsername(); + @NonNull @Param(1) String getUsername(); /** * Gets the resultant User instance which was loaded. * * @return the user instance */ - @NonNull - @Param(2) - User getUser(); + @NonNull @Param(2) User getUser(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/event/user/track/UserTrackEvent.java b/api/src/main/java/me/lucko/luckperms/api/event/user/track/UserTrackEvent.java index a86d3608..b3013c33 100644 --- a/api/src/main/java/me/lucko/luckperms/api/event/user/track/UserTrackEvent.java +++ b/api/src/main/java/me/lucko/luckperms/api/event/user/track/UserTrackEvent.java @@ -45,26 +45,21 @@ public interface UserTrackEvent extends LuckPermsEvent, Sourced { * * @return the track involved in the event */ - @NonNull - @Param(0) - Track getTrack(); + @NonNull @Param(0) Track getTrack(); /** * Gets the user who was promoted or demoted * * @return the user involved in the event */ - @NonNull - @Param(1) - User getUser(); + @NonNull @Param(1) User getUser(); /** * Gets the action performed * * @return the action performed */ - @NonNull - TrackAction getAction(); + @NonNull TrackAction getAction(); /** * Gets the group the user was promoted/demoted from. @@ -73,17 +68,13 @@ public interface UserTrackEvent extends LuckPermsEvent, Sourced { * * @return the group the user was promoted/demoted from */ - @NonNull - @Param(2) - Optional getGroupFrom(); + @NonNull @Param(2) Optional getGroupFrom(); /** * Gets the group the user was promoted/demoted to * * @return the group the user was promoted/demoted to */ - @NonNull - @Param(3) - Optional getGroupTo(); + @NonNull @Param(3) Optional getGroupTo(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/manager/GroupManager.java b/api/src/main/java/me/lucko/luckperms/api/manager/GroupManager.java index aab88424..b6557114 100644 --- a/api/src/main/java/me/lucko/luckperms/api/manager/GroupManager.java +++ b/api/src/main/java/me/lucko/luckperms/api/manager/GroupManager.java @@ -74,8 +74,7 @@ public interface GroupManager { * @throws NullPointerException if the name is null * @since 4.1 */ - @NonNull - CompletableFuture createAndLoadGroup(@NonNull String name); + @NonNull CompletableFuture createAndLoadGroup(@NonNull String name); /** * Loads a group from the plugin's storage provider into memory. @@ -95,8 +94,7 @@ public interface GroupManager { * @throws NullPointerException if the name is null * @since 4.1 */ - @NonNull - CompletableFuture> loadGroup(@NonNull String name); + @NonNull CompletableFuture> loadGroup(@NonNull String name); /** * Saves a group's data back to the plugin's storage provider. @@ -115,8 +113,7 @@ public interface GroupManager { * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @since 4.1 */ - @NonNull - CompletableFuture saveGroup(@NonNull Group group); + @NonNull CompletableFuture saveGroup(@NonNull Group group); /** * Permanently deletes a group from the plugin's storage provider. @@ -127,15 +124,13 @@ public interface GroupManager { *

Unlike the method in {@link Storage}, when a group cannot be deleted, * the future will be {@link CompletableFuture completed exceptionally}.

* - * * @param group the group to delete * @return a future to encapsulate the operation. * @throws NullPointerException if group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @since 4.1 */ - @NonNull - CompletableFuture deleteGroup(@NonNull Group group); + @NonNull CompletableFuture deleteGroup(@NonNull Group group); /** * Loads all groups into memory. @@ -149,8 +144,7 @@ public interface GroupManager { * @return a future to encapsulate the operation. * @since 4.1 */ - @NonNull - CompletableFuture loadAllGroups(); + @NonNull CompletableFuture loadAllGroups(); /** * Searches for a list of groups with a given permission. @@ -160,8 +154,7 @@ public interface GroupManager { * @throws NullPointerException if the permission is null * @since 4.2 */ - @NonNull - CompletableFuture>> getWithPermission(@NonNull String permission); + @NonNull CompletableFuture>> getWithPermission(@NonNull String permission); /** * Gets a loaded group. @@ -170,8 +163,7 @@ public interface GroupManager { * @return a {@link Group} object, if one matching the name exists, or null if not * @throws NullPointerException if the name is null */ - @Nullable - Group getGroup(@NonNull String name); + @Nullable Group getGroup(@NonNull String name); /** * Gets a loaded group. @@ -191,8 +183,7 @@ public interface GroupManager { * * @return a {@link Set} of {@link Group} objects */ - @NonNull - Set getLoadedGroups(); + @NonNull Set getLoadedGroups(); /** * Check if a group is loaded in memory diff --git a/api/src/main/java/me/lucko/luckperms/api/manager/TrackManager.java b/api/src/main/java/me/lucko/luckperms/api/manager/TrackManager.java index 25d9bf0d..3890c0a7 100644 --- a/api/src/main/java/me/lucko/luckperms/api/manager/TrackManager.java +++ b/api/src/main/java/me/lucko/luckperms/api/manager/TrackManager.java @@ -72,8 +72,7 @@ public interface TrackManager { * @throws NullPointerException if the name is null * @since 4.1 */ - @NonNull - CompletableFuture createAndLoadTrack(@NonNull String name); + @NonNull CompletableFuture createAndLoadTrack(@NonNull String name); /** * Loads a track from the plugin's storage provider into memory. @@ -93,8 +92,7 @@ public interface TrackManager { * @throws NullPointerException if the name is null * @since 4.1 */ - @NonNull - CompletableFuture> loadTrack(@NonNull String name); + @NonNull CompletableFuture> loadTrack(@NonNull String name); /** * Saves a track's data back to the plugin's storage provider. @@ -113,8 +111,7 @@ public interface TrackManager { * @throws IllegalStateException if the track instance was not obtained from LuckPerms. * @since 4.1 */ - @NonNull - CompletableFuture saveTrack(@NonNull Track track); + @NonNull CompletableFuture saveTrack(@NonNull Track track); /** * Permanently deletes a track from the plugin's storage provider. @@ -125,15 +122,13 @@ public interface TrackManager { *

Unlike the method in {@link Storage}, when a track cannot be deleted, * the future will be {@link CompletableFuture completed exceptionally}.

* - * * @param track the track to delete * @return a future to encapsulate the operation. * @throws NullPointerException if track is null * @throws IllegalStateException if the track instance was not obtained from LuckPerms. * @since 4.1 */ - @NonNull - CompletableFuture deleteTrack(@NonNull Track track); + @NonNull CompletableFuture deleteTrack(@NonNull Track track); /** * Loads all tracks into memory. @@ -147,8 +142,7 @@ public interface TrackManager { * @return a future to encapsulate the operation. * @since 4.1 */ - @NonNull - CompletableFuture loadAllTracks(); + @NonNull CompletableFuture loadAllTracks(); /** * Gets a loaded track. @@ -157,8 +151,7 @@ public interface TrackManager { * @return a {@link Track} object, if one matching the name exists, or null if not * @throws NullPointerException if the name is null */ - @Nullable - Track getTrack(@NonNull String name); + @Nullable Track getTrack(@NonNull String name); /** * Gets a loaded track. @@ -178,8 +171,7 @@ public interface TrackManager { * * @return a {@link Set} of {@link Track} objects */ - @NonNull - Set getLoadedTracks(); + @NonNull Set getLoadedTracks(); /** * Check if a track is loaded in memory diff --git a/api/src/main/java/me/lucko/luckperms/api/manager/UserManager.java b/api/src/main/java/me/lucko/luckperms/api/manager/UserManager.java index 815a1fdd..2413fc03 100644 --- a/api/src/main/java/me/lucko/luckperms/api/manager/UserManager.java +++ b/api/src/main/java/me/lucko/luckperms/api/manager/UserManager.java @@ -71,14 +71,13 @@ public interface UserManager { *

Unlike the method in {@link Storage}, when a user cannot be loaded, * the future will be {@link CompletableFuture completed exceptionally}.

* - * @param uuid the uuid of the user + * @param uuid the uuid of the user * @param username the username, if known * @return the resultant user * @throws NullPointerException if the uuid is null * @since 4.1 */ - @NonNull - CompletableFuture loadUser(@NonNull UUID uuid, @Nullable String username); + @NonNull CompletableFuture loadUser(@NonNull UUID uuid, @Nullable String username); /** * Loads a user from the plugin's storage provider into memory. @@ -110,8 +109,7 @@ public interface UserManager { * @throws IllegalArgumentException if the username is invalid * @since 4.2 */ - @NonNull - CompletableFuture lookupUuid(@NonNull String username); + @NonNull CompletableFuture lookupUuid(@NonNull String username); /** * Uses the LuckPerms cache to find a username for the given uuid. @@ -122,8 +120,7 @@ public interface UserManager { * @throws IllegalArgumentException if the username is invalid * @since 4.2 */ - @NonNull - CompletableFuture lookupUsername(@NonNull UUID uuid); + @NonNull CompletableFuture lookupUsername(@NonNull UUID uuid); /** * Saves a user's data back to the plugin's storage provider. @@ -142,8 +139,7 @@ public interface UserManager { * @throws IllegalStateException if the user instance was not obtained from LuckPerms. * @since 4.1 */ - @NonNull - CompletableFuture saveUser(@NonNull User user); + @NonNull CompletableFuture saveUser(@NonNull User user); /** * Saves data about a player to the uuid caching system. @@ -155,8 +151,7 @@ public interface UserManager { * @throws IllegalArgumentException if the username is invalid * @since 4.2 */ - @NonNull - CompletableFuture savePlayerData(@NonNull UUID uuid, @NonNull String username); + @NonNull CompletableFuture savePlayerData(@NonNull UUID uuid, @NonNull String username); /** * Gets a set all "unique" user UUIDs. @@ -166,8 +161,7 @@ public interface UserManager { * @return a set of uuids * @since 4.2 */ - @NonNull - CompletableFuture> getUniqueUsers(); + @NonNull CompletableFuture> getUniqueUsers(); /** * Searches for a list of users with a given permission. @@ -177,8 +171,7 @@ public interface UserManager { * @throws NullPointerException if the permission is null * @since 4.2 */ - @NonNull - CompletableFuture>> getWithPermission(@NonNull String permission); + @NonNull CompletableFuture>> getWithPermission(@NonNull String permission); /** * Gets a loaded user. @@ -187,8 +180,7 @@ public interface UserManager { * @return a {@link User} object, if one matching the uuid is loaded, or null if not * @throws NullPointerException if the uuid is null */ - @Nullable - User getUser(@NonNull UUID uuid); + @Nullable User getUser(@NonNull UUID uuid); /** * Gets a loaded user. @@ -208,8 +200,7 @@ public interface UserManager { * @return a {@link User} object, if one matching the uuid is loaded, or null if not * @throws NullPointerException if the name is null */ - @Nullable - User getUser(@NonNull String name); + @Nullable User getUser(@NonNull String name); /** * Gets a loaded user. @@ -227,8 +218,7 @@ public interface UserManager { * * @return a {@link Set} of {@link User} objects */ - @NonNull - Set getLoadedUsers(); + @NonNull Set getLoadedUsers(); /** * Check if a user is loaded in memory diff --git a/api/src/main/java/me/lucko/luckperms/api/messenger/MessengerProvider.java b/api/src/main/java/me/lucko/luckperms/api/messenger/MessengerProvider.java index 033c931a..a912c905 100644 --- a/api/src/main/java/me/lucko/luckperms/api/messenger/MessengerProvider.java +++ b/api/src/main/java/me/lucko/luckperms/api/messenger/MessengerProvider.java @@ -35,8 +35,8 @@ import org.checkerframework.checker.nullness.qual.NonNull; *

Users wishing to provide their own implementation for the plugins * "Messaging Service" should implement and register this interface.

* - * @since 4.1 * @see LuckPermsApi#registerMessengerProvider(MessengerProvider) + * @since 4.1 */ public interface MessengerProvider { @@ -45,8 +45,7 @@ public interface MessengerProvider { * * @return the provider name */ - @NonNull - String getName(); + @NonNull String getName(); /** * Creates and returns a new {@link Messenger} instance, which passes @@ -59,7 +58,6 @@ public interface MessengerProvider { * incoming messages to * @return a new messenger agent instance */ - @NonNull - Messenger obtain(@NonNull IncomingMessageConsumer incomingMessageConsumer); + @NonNull Messenger obtain(@NonNull IncomingMessageConsumer incomingMessageConsumer); } diff --git a/api/src/main/java/me/lucko/luckperms/api/messenger/message/Message.java b/api/src/main/java/me/lucko/luckperms/api/messenger/message/Message.java index fcddc8e9..71084455 100644 --- a/api/src/main/java/me/lucko/luckperms/api/messenger/message/Message.java +++ b/api/src/main/java/me/lucko/luckperms/api/messenger/message/Message.java @@ -46,7 +46,6 @@ public interface Message { * * @return the id of the message */ - @NonNull - UUID getId(); + @NonNull UUID getId(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/messenger/message/OutgoingMessage.java b/api/src/main/java/me/lucko/luckperms/api/messenger/message/OutgoingMessage.java index 55a2ee23..cdba6628 100644 --- a/api/src/main/java/me/lucko/luckperms/api/messenger/message/OutgoingMessage.java +++ b/api/src/main/java/me/lucko/luckperms/api/messenger/message/OutgoingMessage.java @@ -56,7 +56,6 @@ public interface OutgoingMessage extends Message { * * @return an encoded string form of the message */ - @NonNull - String asEncodedString(); + @NonNull String asEncodedString(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/LogMessage.java b/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/LogMessage.java index 5951a073..9f8448ed 100644 --- a/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/LogMessage.java +++ b/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/LogMessage.java @@ -44,7 +44,6 @@ public interface LogMessage extends Message { * * @return the log entry */ - @NonNull - LogEntry getLogEntry(); + @NonNull LogEntry getLogEntry(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/UserUpdateMessage.java b/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/UserUpdateMessage.java index 82a7776c..2cfe7cec 100644 --- a/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/UserUpdateMessage.java +++ b/api/src/main/java/me/lucko/luckperms/api/messenger/message/type/UserUpdateMessage.java @@ -45,7 +45,6 @@ public interface UserUpdateMessage extends Message { * * @return the user */ - @NonNull - UUID getUser(); + @NonNull UUID getUser(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackDefinition.java b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackDefinition.java index 2ca51d46..85303174 100644 --- a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackDefinition.java +++ b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackDefinition.java @@ -47,31 +47,27 @@ public interface MetaStackDefinition { * * @return the elements in this stack */ - @NonNull - List getElements(); + @NonNull List getElements(); /** * Gets the spacer string added before any stack elements * * @return the start spacer */ - @NonNull - String getStartSpacer(); + @NonNull String getStartSpacer(); /** * Gets the spacer added between stack elements * * @return the middle spacer */ - @NonNull - String getMiddleSpacer(); + @NonNull String getMiddleSpacer(); /** * Gets the spacer added after any stack elements * * @return the end spacer */ - @NonNull - String getEndSpacer(); + @NonNull String getEndSpacer(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackElement.java b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackElement.java index 047b674f..1dc7c04b 100644 --- a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackElement.java +++ b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackElement.java @@ -48,8 +48,8 @@ public interface MetaStackElement { * *

The element being considered can be retrieved using {@link ChatMetaType#getEntry(Node)}.

* - * @param node the node being considered - * @param type the type of entry being accumulated + * @param node the node being considered + * @param type the type of entry being accumulated * @param current the current value being used. If this returns true, the current value will be replaced by this entry * @return true if the node should be accumulated into this element, replacing the current value */ diff --git a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackFactory.java b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackFactory.java index 2ededcef..3dc63ba0 100644 --- a/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackFactory.java +++ b/api/src/main/java/me/lucko/luckperms/api/metastacking/MetaStackFactory.java @@ -43,8 +43,7 @@ public interface MetaStackFactory { * @param definition the definition * @return the parsed element, if present */ - @NonNull - Optional fromString(@NonNull String definition); + @NonNull Optional fromString(@NonNull String definition); /** * Parses a list of {@link MetaStackElement}s from string, using the pre-defined elements in the plugin. @@ -54,19 +53,17 @@ public interface MetaStackFactory { * @param definitions the definition strings * @return a list of parsed elements */ - @NonNull - List fromStrings(@NonNull List definitions); + @NonNull List fromStrings(@NonNull List definitions); /** * Creates a new {@link MetaStackDefinition} with the given properties. * - * @param elements the elements to be included in the stack. - * @param startSpacer the spacer to be included at the start of the stacks output + * @param elements the elements to be included in the stack. + * @param startSpacer the spacer to be included at the start of the stacks output * @param middleSpacer the spacer to be included between stack elements - * @param endSpacer the spacer to be included at the end of the stacks output + * @param endSpacer the spacer to be included at the end of the stacks output * @return the new stack definition instance */ - @NonNull - MetaStackDefinition createDefinition(@NonNull List elements, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer); + @NonNull MetaStackDefinition createDefinition(@NonNull List elements, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer); } diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/DisplayNameType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/DisplayNameType.java index f68d5308..28e56375 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/DisplayNameType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/DisplayNameType.java @@ -41,14 +41,14 @@ public interface DisplayNameType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the display name. * * @return the display name */ - @NonNull - String getDisplayName(); + @NonNull String getDisplayName(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/InheritanceType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/InheritanceType.java index 3800b706..5e9b9223 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/InheritanceType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/InheritanceType.java @@ -42,7 +42,8 @@ public interface InheritanceType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the name of the group to be inherited. @@ -51,7 +52,6 @@ public interface InheritanceType extends NodeType { * * @return the name of the group */ - @NonNull - String getGroupName(); + @NonNull String getGroupName(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/MetaType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/MetaType.java index bb63c12c..4ce05a76 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/MetaType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/MetaType.java @@ -43,23 +43,22 @@ public interface MetaType extends NodeType, Map.Entry { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the meta key. * * @return the meta key */ - @NonNull - String getKey(); + @NonNull String getKey(); /** * Gets the meta value. * * @return the meta value */ - @NonNull - String getValue(); + @NonNull String getValue(); @Override @Deprecated diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/PrefixType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/PrefixType.java index ad4bee07..0fa71ec1 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/PrefixType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/PrefixType.java @@ -43,7 +43,8 @@ public interface PrefixType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the priority of the prefix assignment. @@ -57,8 +58,7 @@ public interface PrefixType extends NodeType { * * @return the prefix */ - @NonNull - String getPrefix(); + @NonNull String getPrefix(); /** * Gets a representation of this instance as a {@link Map.Entry}. diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/RegexType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/RegexType.java index e965085d..de939faf 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/RegexType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/RegexType.java @@ -44,15 +44,15 @@ public interface RegexType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the non-compiled pattern string. * * @return the pattern string */ - @NonNull - String getPatternString(); + @NonNull String getPatternString(); /** * Gets the pattern for the regex node. @@ -61,7 +61,6 @@ public interface RegexType extends NodeType { * * @return the pattern */ - @NonNull - Optional getPattern(); + @NonNull Optional getPattern(); } diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/SuffixType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/SuffixType.java index 4cb2a95d..b0c79aaf 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/SuffixType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/SuffixType.java @@ -43,7 +43,8 @@ public interface SuffixType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the priority of the suffix assignment. @@ -57,8 +58,7 @@ public interface SuffixType extends NodeType { * * @return the suffix */ - @NonNull - String getSuffix(); + @NonNull String getSuffix(); /** * Gets a representation of this instance as a {@link Map.Entry}. diff --git a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/WeightType.java b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/WeightType.java index b4f78192..cbca93c8 100644 --- a/api/src/main/java/me/lucko/luckperms/api/nodetype/types/WeightType.java +++ b/api/src/main/java/me/lucko/luckperms/api/nodetype/types/WeightType.java @@ -39,7 +39,8 @@ public interface WeightType extends NodeType { /** * The key for this type. */ - NodeTypeKey KEY = new NodeTypeKey(){}; + NodeTypeKey KEY = new NodeTypeKey() { + }; /** * Gets the weight value. diff --git a/api/src/main/java/me/lucko/luckperms/api/platform/PlatformInfo.java b/api/src/main/java/me/lucko/luckperms/api/platform/PlatformInfo.java index f5ea9430..82345a3d 100644 --- a/api/src/main/java/me/lucko/luckperms/api/platform/PlatformInfo.java +++ b/api/src/main/java/me/lucko/luckperms/api/platform/PlatformInfo.java @@ -42,8 +42,7 @@ public interface PlatformInfo { * * @return the version of the plugin running on the platform */ - @NonNull - String getVersion(); + @NonNull String getVersion(); /** * Gets the API version @@ -57,16 +56,14 @@ public interface PlatformInfo { * * @return the type of platform LuckPerms is running on */ - @NonNull - PlatformType getType(); + @NonNull PlatformType getType(); /** * Gets the unique players which have connected to the server since it started. * * @return the unique connections */ - @NonNull - Set getUniqueConnections(); + @NonNull Set getUniqueConnections(); /** * Gets the time when the plugin first started in milliseconds. diff --git a/api/src/main/java/me/lucko/luckperms/api/platform/PlatformType.java b/api/src/main/java/me/lucko/luckperms/api/platform/PlatformType.java index 1e1190e0..04e31509 100644 --- a/api/src/main/java/me/lucko/luckperms/api/platform/PlatformType.java +++ b/api/src/main/java/me/lucko/luckperms/api/platform/PlatformType.java @@ -34,11 +34,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; */ public enum PlatformType { - BUKKIT("Bukkit"), - BUNGEE("Bungee"), - SPONGE("Sponge"), - NUKKIT("Nukkit"), - VELOCITY("Velocity"); + BUKKIT("Bukkit"), BUNGEE("Bungee"), SPONGE("Sponge"), NUKKIT("Nukkit"), VELOCITY("Velocity"); private final String friendlyName; diff --git a/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/LPSubjectReference.java b/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/LPSubjectReference.java index cfc0904f..0383c5ec 100644 --- a/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/LPSubjectReference.java +++ b/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/LPSubjectReference.java @@ -35,7 +35,6 @@ import java.util.concurrent.CompletableFuture; */ public interface LPSubjectReference extends SubjectReference { - @NonNull - CompletableFuture resolveLp(); + @NonNull CompletableFuture resolveLp(); }