diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 59d2d8f1..556452ee 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,9 +20,5 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Checkout submodules - uses: srt32/git-actions@v0.0.3 - with: - args: git submodule update --init --recursive - name: Build with Maven run: mvn -B package --file pom.xml diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 737e98db..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "cloud-pipeline"] - path = cloud-pipeline - url = https://github.com/IntellectualSites/Rorledning diff --git a/README.md b/README.md index 22ffece1..39a3ae03 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ The code is based on a (W.I.P) paper that can be found [here](https://github.com - **cloud-core**: Core module containing most of the cloud API, and shared implementations - **cloud-annotations**: Annotation processing code that allows you to use annotated methods rather than builders - **cloud-jline**: W.I.P JLine3 implementation of cloud +- **cloud-services**: Services for Cloud - **cloud-minecraft/cloud-brigadier**: Brigadier mappings for cloud - **cloud-minecraft/cloud-bukkit**: Bukkit 1.8.8+ implementation of cloud - **cloud-minecraft/cloud-paper**: Module that extends cloud-bukkit to add special support for Paper 1.8.8+ @@ -74,10 +75,8 @@ The code is based on a (W.I.P) paper that can be found [here](https://github.com ## develop & build -To clone the repository, use `git clone --recursive https://github.com/Sauilitired/cloud.git`. -To then build it, use `mvn clean package`. If you've already cloned the repository without -doing it recursively, use `git submodule update --remote` to update the submodule. This is -only needed the first time, as Maven will perform this operation when building. +To clone the repository, use `git clone https://github.com/Sauilitired/cloud.git`. +To then build it, use `mvn clean package`. There is a bash script (`build.sh`) that performs the submodule updating & builds the project. Feel free to use this if you want to. @@ -96,7 +95,7 @@ To use `cloud` you will first need to add it as a dependency to your project. Cl ```xml - com.intellectualsites + cloud.commandframework cloud-PLATFORM 0.2.0-SNAPSHOT @@ -105,7 +104,7 @@ To use `cloud` you will first need to add it as a dependency to your project. Cl ~ to declare commands --> - com.intellectualsites + cloud.commandframework cloud-annotations 0.2.0-SNAPSHOT @@ -136,11 +135,11 @@ with conflicting dependencies: ${project.build.directory}/dependency-reduced-pom.xml - com.intellectualsites.commands + cloud.commandframework YOUR.PACKAGE.HERE.cloud - com.intellectualsites.services + cloud.commandframework.services YOUR.PACKAGE.HERE.cloud.pipeline @@ -159,7 +158,7 @@ repositories { ```groovy dependencies { - implementation 'com.intellectualsites:cloud-PLATFORM:0.2.0-SNAPSHOT' + implementation 'cloud.commandframework:cloud-PLATFORM:0.2.0-SNAPSHOT' } ``` diff --git a/build.sh b/build.sh index 06eefcc5..ea1689a5 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,4 @@ #!/bin/bash -# Make sure all submodules are initialized -git submodule update --remote -# Package all jars - export MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1" ./mvnw -T1C clean package -DskipTests=true diff --git a/checkstyle.xml b/checkstyle.xml index 54a3ed89..c0a7dff1 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -127,7 +127,7 @@ - + diff --git a/cloud-annotations/pom.xml b/cloud-annotations/pom.xml index 80a0b2b2..7699d287 100644 --- a/cloud-annotations/pom.xml +++ b/cloud-annotations/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT 4.0.0 @@ -40,7 +40,7 @@ - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/AnnotationParser.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java similarity index 93% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/AnnotationParser.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java index 26c2c51b..f1a48eef 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/AnnotationParser.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/AnnotationParser.java @@ -21,20 +21,22 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; +import cloud.commandframework.Command; +import cloud.commandframework.CommandManager; +import cloud.commandframework.Description; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ParserParameter; +import cloud.commandframework.arguments.parser.StandardParameters; +import cloud.commandframework.execution.CommandExecutionHandler; +import cloud.commandframework.extra.confirmation.CommandConfirmationManager; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; import com.google.common.collect.Maps; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.arguments.parser.StandardParameters; -import com.intellectualsites.commands.execution.CommandExecutionHandler; -import com.intellectualsites.commands.extra.confirmation.CommandConfirmationManager; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.arguments.parser.ParserParameters; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -49,7 +51,7 @@ import java.util.Map; import java.util.function.Function; /** - * Parser that parses class instances {@link com.intellectualsites.commands.Command commands} + * Parser that parses class instances {@link Command commands} * * @param Command sender type */ @@ -70,7 +72,7 @@ public final class AnnotationParser { * @param commandSenderClass Command sender class * @param metaMapper Function that is used to create {@link CommandMeta} instances from annotations on the * command methods. These annotations will be mapped to - * {@link com.intellectualsites.commands.arguments.parser.ParserParameter}. Mappers for the + * {@link ParserParameter}. Mappers for the * parser parameters can be registered using {@link #registerAnnotationMapper(Class, Function)} */ public AnnotationParser(@Nonnull final CommandManager manager, @@ -183,7 +185,7 @@ public final class AnnotationParser { } final String description = argumentDescriptions.getOrDefault(argument, ""); - builder = builder.argument(argument, com.intellectualsites.commands.Description.of(description)); + builder = builder.argument(argument, Description.of(description)); } } /* Try to find the command sender type */ diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Argument.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Argument.java similarity index 97% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Argument.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/Argument.java index 42834339..fc4157c8 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Argument.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Argument.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentExtractor.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentExtractor.java similarity index 97% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentExtractor.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentExtractor.java index 822d4678..cd77879d 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentExtractor.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentExtractor.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import javax.annotation.Nonnull; import java.lang.reflect.Method; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentMode.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentMode.java similarity index 95% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentMode.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentMode.java index cef5d6b4..8921415a 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentMode.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentMode.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; enum ArgumentMode { LITERAL, diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentParameterPair.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentParameterPair.java similarity index 96% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentParameterPair.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentParameterPair.java index 91e4ea57..d0d23b8f 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ArgumentParameterPair.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ArgumentParameterPair.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import javax.annotation.Nonnull; import java.lang.reflect.Parameter; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandDescription.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandDescription.java similarity index 90% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandDescription.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandDescription.java index afaa6ab8..baf23c9f 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandDescription.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandDescription.java @@ -21,7 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; + +import cloud.commandframework.arguments.parser.StandardParameters; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -29,7 +31,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Maps to {@link com.intellectualsites.commands.arguments.parser.StandardParameters#DESCRIPTION} + * Maps to {@link StandardParameters#DESCRIPTION} */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethod.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethod.java similarity index 97% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethod.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethod.java index b9746b24..79ee3605 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethod.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethod.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethodPair.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethodPair.java similarity index 96% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethodPair.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethodPair.java index 4f12e3f2..e66b53e7 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/CommandMethodPair.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/CommandMethodPair.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import javax.annotation.Nonnull; import java.lang.reflect.Method; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Confirmation.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Confirmation.java similarity index 96% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Confirmation.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/Confirmation.java index bf905dfe..ad5ccc06 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Confirmation.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Confirmation.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Hidden.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Hidden.java similarity index 92% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Hidden.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/Hidden.java index e8ac3b48..2eb046c5 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/Hidden.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/Hidden.java @@ -21,7 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; + +import cloud.commandframework.Command; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -29,7 +31,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Indicates that the command should be hidden. Similar to {@link com.intellectualsites.commands.Command.Builder#hidden()} + * Indicates that the command should be hidden. Similar to {@link Command.Builder#hidden()} */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MetaFactory.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MetaFactory.java similarity index 92% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MetaFactory.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/MetaFactory.java index 4ce46591..259f58f2 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MetaFactory.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MetaFactory.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.meta.CommandMeta; +import cloud.commandframework.arguments.parser.ParserParameters; +import cloud.commandframework.meta.CommandMeta; import javax.annotation.Nonnull; import java.lang.annotation.Annotation; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MethodCommandExecutionHandler.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java similarity index 93% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MethodCommandExecutionHandler.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java index 6866bdb6..bfc9341f 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/MethodCommandExecutionHandler.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/MethodCommandExecutionHandler.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.execution.CommandExecutionHandler; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.execution.CommandExecutionHandler; import javax.annotation.Nonnull; import java.lang.invoke.MethodHandle; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ProxiedBy.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ProxiedBy.java similarity index 92% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ProxiedBy.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/ProxiedBy.java index 7c688501..2a5abdb9 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/ProxiedBy.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/ProxiedBy.java @@ -21,7 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; + +import cloud.commandframework.Command; import javax.annotation.Nonnull; import java.lang.annotation.ElementType; @@ -31,7 +33,7 @@ import java.lang.annotation.Target; /** * Creates a command proxy for the command. This is similar to - * {@link com.intellectualsites.commands.Command.Builder#proxies(com.intellectualsites.commands.Command)}. + * {@link Command.Builder#proxies(Command)}. */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxFragment.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxFragment.java similarity index 97% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxFragment.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxFragment.java index b5678a6b..0fcc8487 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxFragment.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxFragment.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxParser.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxParser.java similarity index 98% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxParser.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxParser.java index 6726c20e..1c23364f 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/SyntaxParser.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/SyntaxParser.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; import javax.annotation.Nonnull; import java.util.ArrayList; diff --git a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/package-info.java b/cloud-annotations/src/main/java/cloud/commandframework/annotations/package-info.java similarity index 95% rename from cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/package-info.java rename to cloud-annotations/src/main/java/cloud/commandframework/annotations/package-info.java index fb11c77f..a61ee954 100644 --- a/cloud-annotations/src/main/java/com/intellectualsites/commands/annotations/package-info.java +++ b/cloud-annotations/src/main/java/cloud/commandframework/annotations/package-info.java @@ -25,4 +25,4 @@ /** * Annotation parsing related classes */ -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; diff --git a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/AnnotationParserTest.java b/cloud-annotations/src/test/java/cloud/commandframework/annotations/AnnotationParserTest.java similarity index 89% rename from cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/AnnotationParserTest.java rename to cloud-annotations/src/test/java/cloud/commandframework/annotations/AnnotationParserTest.java index a918a8a1..a832b5e3 100644 --- a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/AnnotationParserTest.java +++ b/cloud-annotations/src/test/java/cloud/commandframework/annotations/AnnotationParserTest.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.arguments.standard.StringArgument; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.Command; +import cloud.commandframework.CommandManager; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.meta.SimpleCommandMeta; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandManager.java b/cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandManager.java similarity index 84% rename from cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandManager.java rename to cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandManager.java index 5c7cf3ff..bab708b2 100644 --- a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandManager.java +++ b/cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandManager.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.CommandManager; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.internal.CommandRegistrationHandler; +import cloud.commandframework.meta.SimpleCommandMeta; import javax.annotation.Nonnull; diff --git a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandSender.java b/cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandSender.java similarity index 95% rename from cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandSender.java rename to cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandSender.java index 949098a7..2fe3c278 100644 --- a/cloud-annotations/src/test/java/com/intellectualsites/commands/annotations/TestCommandSender.java +++ b/cloud-annotations/src/test/java/cloud/commandframework/annotations/TestCommandSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations; +package cloud.commandframework.annotations; public class TestCommandSender { diff --git a/cloud-core/pom.xml b/cloud-core/pom.xml index 22f01f6c..87599b53 100644 --- a/cloud-core/pom.xml +++ b/cloud-core/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT 4.0.0 @@ -52,8 +52,8 @@ test - com.intellectualsites - cloud-pipeline + cloud.commandframework + cloud-services 1.5.0-SNAPSHOT diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/Command.java b/cloud-core/src/main/java/cloud/commandframework/Command.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/Command.java rename to cloud-core/src/main/java/cloud/commandframework/Command.java index c0c082ae..94eaa38c 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/Command.java +++ b/cloud-core/src/main/java/cloud/commandframework/Command.java @@ -21,15 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.execution.CommandExecutionHandler; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.commands.permission.CommandPermission; -import com.intellectualsites.commands.permission.Permission; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.execution.CommandExecutionHandler; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.permission.CommandPermission; +import cloud.commandframework.permission.Permission; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/CommandHelpHandler.java b/cloud-core/src/main/java/cloud/commandframework/CommandHelpHandler.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/CommandHelpHandler.java rename to cloud-core/src/main/java/cloud/commandframework/CommandHelpHandler.java index 5076ae90..2739df72 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/CommandHelpHandler.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandHelpHandler.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; import javax.annotation.Nonnull; import java.util.ArrayList; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/CommandManager.java b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/CommandManager.java rename to cloud-core/src/main/java/cloud/commandframework/CommandManager.java index 04ce633b..56b43b47 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/CommandManager.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandManager.java @@ -21,36 +21,38 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandSyntaxFormatter; +import cloud.commandframework.arguments.StandardCommandSyntaxFormatter; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ParserParameter; +import cloud.commandframework.arguments.parser.ParserRegistry; +import cloud.commandframework.arguments.parser.StandardParserRegistry; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.context.CommandContextFactory; +import cloud.commandframework.context.StandardCommandContextFactory; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.execution.CommandResult; +import cloud.commandframework.execution.CommandSuggestionProcessor; +import cloud.commandframework.execution.FilteringCommandSuggestionProcessor; +import cloud.commandframework.execution.postprocessor.AcceptingCommandPostprocessor; +import cloud.commandframework.execution.postprocessor.CommandPostprocessingContext; +import cloud.commandframework.execution.postprocessor.CommandPostprocessor; +import cloud.commandframework.execution.preprocessor.AcceptingCommandPreprocessor; +import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; +import cloud.commandframework.execution.preprocessor.CommandPreprocessor; +import cloud.commandframework.internal.CommandRegistrationHandler; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.CommandSyntaxFormatter; -import com.intellectualsites.commands.arguments.StandardCommandSyntaxFormatter; -import com.intellectualsites.commands.arguments.parser.ParserRegistry; -import com.intellectualsites.commands.arguments.parser.StandardParserRegistry; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.context.CommandContextFactory; -import com.intellectualsites.commands.context.StandardCommandContextFactory; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.execution.CommandResult; -import com.intellectualsites.commands.execution.CommandSuggestionProcessor; -import com.intellectualsites.commands.execution.FilteringCommandSuggestionProcessor; -import com.intellectualsites.commands.execution.postprocessor.AcceptingCommandPostprocessor; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessingContext; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessor; -import com.intellectualsites.commands.execution.preprocessor.AcceptingCommandPreprocessor; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessingContext; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessor; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.permission.CommandPermission; -import com.intellectualsites.commands.permission.OrPermission; -import com.intellectualsites.commands.permission.Permission; -import com.intellectualsites.services.ServicePipeline; -import com.intellectualsites.services.State; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.permission.CommandPermission; +import cloud.commandframework.permission.OrPermission; +import cloud.commandframework.permission.Permission; +import cloud.commandframework.services.ServicePipeline; +import cloud.commandframework.services.State; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -466,9 +468,9 @@ public abstract class CommandManager { /** * Get the parser registry instance. The parser registry contains default - * mappings to {@link com.intellectualsites.commands.arguments.parser.ArgumentParser} + * mappings to {@link ArgumentParser} * and allows for the registration of custom mappings. The parser registry also - * contains mappings of annotations to {@link com.intellectualsites.commands.arguments.parser.ParserParameter} + * contains mappings of annotations to {@link ParserParameter} * which allows for annotations to be used to customize parser settings. *

* When creating a new parser type, it is recommended to register it in the parser diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/CommandTree.java b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/CommandTree.java rename to cloud-core/src/main/java/cloud/commandframework/CommandTree.java index 265284b1..15635911 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/CommandTree.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java @@ -21,21 +21,21 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.AmbiguousNodeException; -import com.intellectualsites.commands.exceptions.ArgumentParseException; -import com.intellectualsites.commands.exceptions.InvalidCommandSenderException; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoCommandInLeafException; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; -import com.intellectualsites.commands.permission.CommandPermission; -import com.intellectualsites.commands.permission.OrPermission; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.exceptions.AmbiguousNodeException; +import cloud.commandframework.exceptions.ArgumentParseException; +import cloud.commandframework.exceptions.InvalidCommandSenderException; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoCommandInLeafException; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.exceptions.NoSuchCommandException; +import cloud.commandframework.permission.CommandPermission; +import cloud.commandframework.permission.OrPermission; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/Description.java b/cloud-core/src/main/java/cloud/commandframework/Description.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/Description.java rename to cloud-core/src/main/java/cloud/commandframework/Description.java index e5119fca..1626473e 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/Description.java +++ b/cloud-core/src/main/java/cloud/commandframework/Description.java @@ -21,12 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; + +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; /** - * {@link com.intellectualsites.commands.arguments.CommandArgument} description + * {@link CommandArgument} description */ public final class Description { diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Completions.java b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Completions.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Completions.java rename to cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Completions.java index 5bd2b60f..fa1aecdd 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Completions.java +++ b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Completions.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations.specifier; +package cloud.commandframework.annotations.specifier; import java.lang.annotation.ElementType; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Range.java b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Range.java similarity index 92% rename from cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Range.java rename to cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Range.java index fccaeb65..2cbefe0b 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/Range.java +++ b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/Range.java @@ -21,7 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.annotations.specifier; +package cloud.commandframework.annotations.specifier; + +import cloud.commandframework.arguments.parser.ArgumentParser; import javax.annotation.Nonnull; import java.lang.annotation.ElementType; @@ -31,7 +33,7 @@ import java.lang.annotation.Target; /** * Used to specify min and max values of numerical - * {@link com.intellectualsites.commands.arguments.parser.ArgumentParser parsers} + * {@link ArgumentParser parsers} */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/package-info.java b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/package-info.java similarity index 83% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/annotations/specifier/package-info.java index 8c01c78c..d78350d1 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/annotations/specifier/package-info.java @@ -23,6 +23,7 @@ // /** - * Parser classes used to parse {@link com.intellectualsites.commands.arguments.CommandArgument} + * Standard annotations used to match {@link cloud.commandframework.arguments.parser.ArgumentParser} + * in {@link cloud.commandframework.arguments.parser.ParserRegistry} */ -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.annotations.specifier; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java index 3497d61b..94f3ec26 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandArgument.java @@ -21,15 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; +import cloud.commandframework.arguments.parser.ArgumentParser; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.Command; +import cloud.commandframework.CommandManager; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ParserParameters; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandSyntaxFormatter.java b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandSyntaxFormatter.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandSyntaxFormatter.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/CommandSyntaxFormatter.java index fe331303..7ae8b6e2 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/CommandSyntaxFormatter.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/CommandSyntaxFormatter.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; -import com.intellectualsites.commands.CommandTree; +import cloud.commandframework.CommandTree; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/DelegatingSuggestionsProvider.java b/cloud-core/src/main/java/cloud/commandframework/arguments/DelegatingSuggestionsProvider.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/DelegatingSuggestionsProvider.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/DelegatingSuggestionsProvider.java index b2a1598b..36b4e343 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/DelegatingSuggestionsProvider.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/DelegatingSuggestionsProvider.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/StandardCommandSyntaxFormatter.java b/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/StandardCommandSyntaxFormatter.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java index fa7f9855..d282d6b6 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/StandardCommandSyntaxFormatter.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/StandardCommandSyntaxFormatter.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; -import com.intellectualsites.commands.CommandTree; +import cloud.commandframework.CommandTree; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/StaticArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/StaticArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java index aeafb215..b1e2f43d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/StaticArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/StaticArgument.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.ArrayList; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/package-info.java b/cloud-core/src/main/java/cloud/commandframework/arguments/package-info.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/package-info.java index 306dcde3..d152b7b9 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/package-info.java @@ -25,4 +25,4 @@ /** * Command arguments that are used to build command parsing chains */ -package com.intellectualsites.commands.arguments; +package cloud.commandframework.arguments; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParseResult.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParseResult.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParseResult.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParseResult.java index d5e34941..7b76708a 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParseResult.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParseResult.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import javax.annotation.Nonnull; import java.util.Optional; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParser.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParser.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParser.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParser.java index 76acee4a..c32f6592 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ArgumentParser.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ArgumentParser.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameter.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameter.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameter.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameter.java index 0edd98f4..de6d41ea 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameter.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameter.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import com.google.common.reflect.TypeToken; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameters.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameters.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameters.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameters.java index 98ee984a..3f7cdec8 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserParameters.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserParameters.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import com.google.common.collect.Maps; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserRegistry.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserRegistry.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserRegistry.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserRegistry.java index 6ac85997..3181a5dc 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/ParserRegistry.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/ParserRegistry.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import com.google.common.reflect.TypeToken; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParameters.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParameters.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParameters.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParameters.java index 9327759b..8ceb8d15 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParameters.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParameters.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import com.google.common.reflect.TypeToken; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParserRegistry.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java similarity index 93% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParserRegistry.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java index 051c52c3..afa5e8f6 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/parser/StandardParserRegistry.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java @@ -21,21 +21,21 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.parser; +package cloud.commandframework.arguments.parser; import com.google.common.collect.ImmutableMap; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.annotations.specifier.Completions; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.arguments.standard.BooleanArgument; -import com.intellectualsites.commands.arguments.standard.ByteArgument; -import com.intellectualsites.commands.arguments.standard.CharArgument; -import com.intellectualsites.commands.arguments.standard.DoubleArgument; -import com.intellectualsites.commands.arguments.standard.EnumArgument; -import com.intellectualsites.commands.arguments.standard.FloatArgument; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.arguments.standard.ShortArgument; -import com.intellectualsites.commands.arguments.standard.StringArgument; +import cloud.commandframework.annotations.specifier.Completions; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.arguments.standard.BooleanArgument; +import cloud.commandframework.arguments.standard.ByteArgument; +import cloud.commandframework.arguments.standard.CharArgument; +import cloud.commandframework.arguments.standard.DoubleArgument; +import cloud.commandframework.arguments.standard.EnumArgument; +import cloud.commandframework.arguments.standard.FloatArgument; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.standard.ShortArgument; +import cloud.commandframework.arguments.standard.StringArgument; import javax.annotation.Nonnull; import java.lang.annotation.Annotation; diff --git a/cloud-core/src/main/java/cloud/commandframework/arguments/parser/package-info.java b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/package-info.java new file mode 100644 index 00000000..d66ff291 --- /dev/null +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/parser/package-info.java @@ -0,0 +1,28 @@ +// +// MIT License +// +// Copyright (c) 2020 Alexander Söderberg +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +/** + * Parser classes used to parse {@link cloud.commandframework.arguments.CommandArgument} + */ +package cloud.commandframework.arguments.parser; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/BooleanArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/BooleanArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java index a2c98ac6..34dbbf37 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/BooleanArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/BooleanArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ByteArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ByteArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java index aa0f1627..da0d6d56 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ByteArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ByteArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/CharArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/CharArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java index 82b0689d..5d9ba87a 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/CharArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/CharArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/DoubleArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/DoubleArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java index ea34fbec..a0e58e53 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/DoubleArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/DoubleArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/EnumArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/EnumArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java index 1c8a9b30..95f3c6b9 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/EnumArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/EnumArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/FloatArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/FloatArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java index cf63831e..123fb9c4 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/FloatArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/FloatArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/IntegerArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/IntegerArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java index e332a919..36c4cb55 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/IntegerArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/IntegerArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/LongArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/LongArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java index 187e24dd..67621567 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/LongArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/LongArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ShortArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ShortArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java index 95512378..e503c32d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/ShortArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/ShortArgument.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.parsing.NumberParseException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.exceptions.parsing.NumberParseException; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/StringArgument.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/StringArgument.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java index fc8ea3dc..fb3aebb2 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/StringArgument.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/StringArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/package-info.java b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/arguments/standard/package-info.java index c703eacd..c21101c9 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/arguments/standard/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/arguments/standard/package-info.java @@ -25,4 +25,4 @@ /** * Standard command argument types */ -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContext.java b/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContext.java rename to cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java index dd9eb3b8..d8d87362 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContext.java +++ b/cloud-core/src/main/java/cloud/commandframework/context/CommandContext.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.context; +package cloud.commandframework.context; +import cloud.commandframework.arguments.CommandArgument; import com.google.common.collect.Maps; -import com.intellectualsites.commands.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContextFactory.java b/cloud-core/src/main/java/cloud/commandframework/context/CommandContextFactory.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContextFactory.java rename to cloud-core/src/main/java/cloud/commandframework/context/CommandContextFactory.java index 5f82fbbf..d9f4edc1 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/context/CommandContextFactory.java +++ b/cloud-core/src/main/java/cloud/commandframework/context/CommandContextFactory.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.context; +package cloud.commandframework.context; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/context/StandardCommandContextFactory.java b/cloud-core/src/main/java/cloud/commandframework/context/StandardCommandContextFactory.java similarity index 97% rename from cloud-core/src/main/java/com/intellectualsites/commands/context/StandardCommandContextFactory.java rename to cloud-core/src/main/java/cloud/commandframework/context/StandardCommandContextFactory.java index 4f07e030..aff81c64 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/context/StandardCommandContextFactory.java +++ b/cloud-core/src/main/java/cloud/commandframework/context/StandardCommandContextFactory.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.context; +package cloud.commandframework.context; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/context/package-info.java b/cloud-core/src/main/java/cloud/commandframework/context/package-info.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/context/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/context/package-info.java index c65d0f9f..38fe7f9b 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/context/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/context/package-info.java @@ -26,4 +26,4 @@ * Command context stores values for a command sender * before and during command execution and parsing */ -package com.intellectualsites.commands.context; +package cloud.commandframework.context; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/AmbiguousNodeException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/AmbiguousNodeException.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/AmbiguousNodeException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/AmbiguousNodeException.java index 988f9a68..682868ba 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/AmbiguousNodeException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/AmbiguousNodeException.java @@ -21,9 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.CommandTree; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -31,8 +33,8 @@ import java.util.Iterator; import java.util.List; /** - * Exception thrown when a {@link com.intellectualsites.commands.context.CommandContext} - * is being inserted into a {@link com.intellectualsites.commands.CommandTree} and an ambiguity + * Exception thrown when a {@link CommandContext} + * is being inserted into a {@link CommandTree} and an ambiguity * is detected. */ @SuppressWarnings("unused") diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/ArgumentParseException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/ArgumentParseException.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/ArgumentParseException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/ArgumentParseException.java index 3ab28627..98d7c5af 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/ArgumentParseException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/ArgumentParseException.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/CommandParseException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/CommandParseException.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/CommandParseException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/CommandParseException.java index 9829d35e..b715e992 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/CommandParseException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/CommandParseException.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidCommandSenderException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidCommandSenderException.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidCommandSenderException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidCommandSenderException.java index 4920d4db..c7fcb6ce 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidCommandSenderException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidCommandSenderException.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidSyntaxException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidSyntaxException.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidSyntaxException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidSyntaxException.java index 987b4170..574a1fb4 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/InvalidSyntaxException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/InvalidSyntaxException.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoCommandInLeafException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoCommandInLeafException.java similarity index 92% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoCommandInLeafException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/NoCommandInLeafException.java index c4a08e33..dabe05f9 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoCommandInLeafException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoCommandInLeafException.java @@ -21,15 +21,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; /** * Thrown when a {@link CommandArgument} - * that is registered as a leaf node, does not contain an owning {@link com.intellectualsites.commands.Command} + * that is registered as a leaf node, does not contain an owning {@link Command} */ @SuppressWarnings("unused") public final class NoCommandInLeafException extends IllegalStateException { diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoPermissionException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoPermissionException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java index 3bc00b73..3d5c8693 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoPermissionException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java @@ -21,17 +21,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.permission.CommandPermission; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.permission.CommandPermission; import javax.annotation.Nonnull; import java.util.List; /** * Exception thrown when a command sender misses a permission required - * to execute a {@link com.intellectualsites.commands.Command} + * to execute a {@link Command} */ @SuppressWarnings("unused") public class NoPermissionException extends CommandParseException { diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoSuchCommandException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoSuchCommandException.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoSuchCommandException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/NoSuchCommandException.java index 0bb5a6bd..3f541202 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/NoSuchCommandException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/NoSuchCommandException.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; -import com.intellectualsites.commands.arguments.CommandArgument; +import cloud.commandframework.arguments.CommandArgument; import javax.annotation.Nonnull; import java.util.List; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/package-info.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/package-info.java index a8b9f280..def165d2 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/package-info.java @@ -25,4 +25,4 @@ /** * cloud related exceptions */ -package com.intellectualsites.commands.exceptions; +package cloud.commandframework.exceptions; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/NumberParseException.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/NumberParseException.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/NumberParseException.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/NumberParseException.java index a28f5852..2a9a7ea0 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/NumberParseException.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/NumberParseException.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.exceptions.parsing; +package cloud.commandframework.exceptions.parsing; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/package-info.java b/cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/package-info.java index 4a434678..901508be 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/exceptions/parsing/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/exceptions/parsing/package-info.java @@ -25,4 +25,4 @@ /** * Parsing related exceptions */ -package com.intellectualsites.commands.exceptions.parsing; +package cloud.commandframework.exceptions.parsing; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/AsynchronousCommandExecutionCoordinator.java b/cloud-core/src/main/java/cloud/commandframework/execution/AsynchronousCommandExecutionCoordinator.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/AsynchronousCommandExecutionCoordinator.java rename to cloud-core/src/main/java/cloud/commandframework/execution/AsynchronousCommandExecutionCoordinator.java index 3ed00441..b9998bb0 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/AsynchronousCommandExecutionCoordinator.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/AsynchronousCommandExecutionCoordinator.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.services.State; +import cloud.commandframework.Command; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.services.State; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionCoordinator.java b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionCoordinator.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionCoordinator.java rename to cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionCoordinator.java index cf1135e5..afa1cf2d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionCoordinator.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionCoordinator.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.services.State; +import cloud.commandframework.CommandTree; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.services.State; import javax.annotation.Nonnull; import java.util.Queue; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionHandler.java b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java similarity index 89% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionHandler.java rename to cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java index 5facaef2..a0f0ccf0 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandExecutionHandler.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/CommandExecutionHandler.java @@ -21,14 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.Command; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; /** - * Handler that is invoked whenever a {@link com.intellectualsites.commands.Command} is executed + * Handler that is invoked whenever a {@link Command} is executed * by a command sender * * @param Command sender type diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandResult.java b/cloud-core/src/main/java/cloud/commandframework/execution/CommandResult.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandResult.java rename to cloud-core/src/main/java/cloud/commandframework/execution/CommandResult.java index b93c3a90..cbe207dd 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandResult.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/CommandResult.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandSuggestionProcessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/CommandSuggestionProcessor.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandSuggestionProcessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/CommandSuggestionProcessor.java index 428ecd8c..e4f380a0 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/CommandSuggestionProcessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/CommandSuggestionProcessor.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessingContext; +import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; import java.util.List; import java.util.function.BiFunction; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/FilteringCommandSuggestionProcessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/FilteringCommandSuggestionProcessor.java similarity index 93% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/FilteringCommandSuggestionProcessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/FilteringCommandSuggestionProcessor.java index 85f79264..b4069c65 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/FilteringCommandSuggestionProcessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/FilteringCommandSuggestionProcessor.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessingContext; +import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; import javax.annotation.Nonnull; import java.util.LinkedList; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/package-info.java b/cloud-core/src/main/java/cloud/commandframework/execution/package-info.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/execution/package-info.java index 7e8e2be6..f98e47f6 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/package-info.java @@ -25,4 +25,4 @@ /** * Classes related to command execution and execution coordination */ -package com.intellectualsites.commands.execution; +package cloud.commandframework.execution; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/AcceptingCommandPostprocessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/AcceptingCommandPostprocessor.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/AcceptingCommandPostprocessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/AcceptingCommandPostprocessor.java index 17366130..e05feece 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/AcceptingCommandPostprocessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/AcceptingCommandPostprocessor.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.postprocessor; +package cloud.commandframework.execution.postprocessor; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessingContext.java b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessingContext.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessingContext.java rename to cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessingContext.java index 45821779..9783ce10 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessingContext.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessingContext.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.postprocessor; +package cloud.commandframework.execution.postprocessor; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.Command; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessor.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessor.java index ac825696..f6e98003 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/CommandPostprocessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/CommandPostprocessor.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.postprocessor; +package cloud.commandframework.execution.postprocessor; -import com.intellectualsites.services.types.ConsumerService; +import cloud.commandframework.services.types.ConsumerService; /** * Command postprocessor that acts on commands before execution diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/package-info.java b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/package-info.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/package-info.java index 888a94d5..4ca1f5e6 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/postprocessor/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/postprocessor/package-info.java @@ -25,4 +25,4 @@ /** * Command postprocessing system */ -package com.intellectualsites.commands.execution.postprocessor; +package cloud.commandframework.execution.postprocessor; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/AcceptingCommandPreprocessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/AcceptingCommandPreprocessor.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/AcceptingCommandPreprocessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/AcceptingCommandPreprocessor.java index 1def0070..b391e677 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/AcceptingCommandPreprocessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/AcceptingCommandPreprocessor.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.preprocessor; +package cloud.commandframework.execution.preprocessor; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessingContext.java b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessingContext.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessingContext.java rename to cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessingContext.java index 815eac2e..d5c3fe11 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessingContext.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessingContext.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.preprocessor; +package cloud.commandframework.execution.preprocessor; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.context.CommandContext; import javax.annotation.Nonnull; import java.util.LinkedList; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessor.java b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessor.java similarity index 92% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessor.java rename to cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessor.java index 80bffd58..9215bf2f 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/CommandPreprocessor.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/CommandPreprocessor.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.execution.preprocessor; +package cloud.commandframework.execution.preprocessor; -import com.intellectualsites.services.types.ConsumerService; +import cloud.commandframework.services.types.ConsumerService; /** * Command preprocessor that gets to act on command input diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/package-info.java b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/package-info.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/package-info.java index 7bcbd686..4fa5097a 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/execution/preprocessor/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/execution/preprocessor/package-info.java @@ -25,4 +25,4 @@ /** * Command preprocessing system */ -package com.intellectualsites.commands.execution.preprocessor; +package cloud.commandframework.execution.preprocessor; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/CommandConfirmationManager.java b/cloud-core/src/main/java/cloud/commandframework/extra/confirmation/CommandConfirmationManager.java similarity index 92% rename from cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/CommandConfirmationManager.java rename to cloud-core/src/main/java/cloud/commandframework/extra/confirmation/CommandConfirmationManager.java index aff1047c..9a57a242 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/CommandConfirmationManager.java +++ b/cloud-core/src/main/java/cloud/commandframework/extra/confirmation/CommandConfirmationManager.java @@ -21,16 +21,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.extra.confirmation; +package cloud.commandframework.extra.confirmation; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.execution.CommandExecutionHandler; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessingContext; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessor; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.services.types.ConsumerService; +import cloud.commandframework.CommandManager; +import cloud.commandframework.execution.CommandExecutionHandler; +import cloud.commandframework.execution.postprocessor.CommandPostprocessingContext; +import cloud.commandframework.execution.postprocessor.CommandPostprocessor; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.services.types.ConsumerService; import javax.annotation.Nonnull; import java.util.Optional; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/package-info.java b/cloud-core/src/main/java/cloud/commandframework/extra/confirmation/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/extra/confirmation/package-info.java index c18dc3ff..618fe64d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/extra/confirmation/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/extra/confirmation/package-info.java @@ -25,4 +25,4 @@ /** * Confirmation system */ -package com.intellectualsites.commands.extra.confirmation; +package cloud.commandframework.extra.confirmation; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/internal/CommandRegistrationHandler.java b/cloud-core/src/main/java/cloud/commandframework/internal/CommandRegistrationHandler.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/internal/CommandRegistrationHandler.java rename to cloud-core/src/main/java/cloud/commandframework/internal/CommandRegistrationHandler.java index 704b7bae..6b31a9fa 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/internal/CommandRegistrationHandler.java +++ b/cloud-core/src/main/java/cloud/commandframework/internal/CommandRegistrationHandler.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.internal; +package cloud.commandframework.internal; -import com.intellectualsites.commands.Command; +import cloud.commandframework.Command; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/internal/package-info.java b/cloud-core/src/main/java/cloud/commandframework/internal/package-info.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/internal/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/internal/package-info.java index b158dd39..dff34f40 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/internal/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/internal/package-info.java @@ -25,4 +25,4 @@ /** * Classes that should be used internally in command managers */ -package com.intellectualsites.commands.internal; +package cloud.commandframework.internal; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/meta/CommandMeta.java b/cloud-core/src/main/java/cloud/commandframework/meta/CommandMeta.java similarity index 94% rename from cloud-core/src/main/java/com/intellectualsites/commands/meta/CommandMeta.java rename to cloud-core/src/main/java/cloud/commandframework/meta/CommandMeta.java index d99db69e..f8f93b90 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/meta/CommandMeta.java +++ b/cloud-core/src/main/java/cloud/commandframework/meta/CommandMeta.java @@ -21,14 +21,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.meta; +package cloud.commandframework.meta; + +import cloud.commandframework.Command; import javax.annotation.Nonnull; import java.util.Map; import java.util.Optional; /** - * Object that is associated with a {@link com.intellectualsites.commands.Command}. + * Object that is associated with a {@link Command}. * Command meta should not be mutable, as one fixed instance will be used per command. *

* Appropriate use for command meta would be fixed state, such as command descriptions. diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/meta/SimpleCommandMeta.java b/cloud-core/src/main/java/cloud/commandframework/meta/SimpleCommandMeta.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/meta/SimpleCommandMeta.java rename to cloud-core/src/main/java/cloud/commandframework/meta/SimpleCommandMeta.java index f8ae8df9..d63634cd 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/meta/SimpleCommandMeta.java +++ b/cloud-core/src/main/java/cloud/commandframework/meta/SimpleCommandMeta.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.meta; +package cloud.commandframework.meta; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/meta/package-info.java b/cloud-core/src/main/java/cloud/commandframework/meta/package-info.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/meta/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/meta/package-info.java index 64b5b8ce..7872e573 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/meta/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/meta/package-info.java @@ -25,4 +25,4 @@ /** * Command meta are classes associated with commands that store arbitrary data */ -package com.intellectualsites.commands.meta; +package cloud.commandframework.meta; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/package-info.java b/cloud-core/src/main/java/cloud/commandframework/package-info.java similarity index 91% rename from cloud-core/src/main/java/com/intellectualsites/commands/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/package-info.java index ed297f9d..aa2c4542 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/package-info.java @@ -25,6 +25,6 @@ /** * cloud API main package * - * @see com.intellectualsites.commands.CommandManager Command manager class + * @see cloud.commandframework.CommandManager Command manager class */ -package com.intellectualsites.commands; +package cloud.commandframework; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/permission/CommandPermission.java b/cloud-core/src/main/java/cloud/commandframework/permission/CommandPermission.java similarity index 96% rename from cloud-core/src/main/java/com/intellectualsites/commands/permission/CommandPermission.java rename to cloud-core/src/main/java/cloud/commandframework/permission/CommandPermission.java index f58a2e61..b3f6fc56 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/permission/CommandPermission.java +++ b/cloud-core/src/main/java/cloud/commandframework/permission/CommandPermission.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.permission; +package cloud.commandframework.permission; import javax.annotation.Nonnull; import java.util.Collection; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/permission/OrPermission.java b/cloud-core/src/main/java/cloud/commandframework/permission/OrPermission.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/permission/OrPermission.java rename to cloud-core/src/main/java/cloud/commandframework/permission/OrPermission.java index 54814247..1fddabd6 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/permission/OrPermission.java +++ b/cloud-core/src/main/java/cloud/commandframework/permission/OrPermission.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.permission; +package cloud.commandframework.permission; import javax.annotation.Nonnull; import java.util.Collection; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/permission/Permission.java b/cloud-core/src/main/java/cloud/commandframework/permission/Permission.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/permission/Permission.java rename to cloud-core/src/main/java/cloud/commandframework/permission/Permission.java index 88402e92..3ab1b72d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/permission/Permission.java +++ b/cloud-core/src/main/java/cloud/commandframework/permission/Permission.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.permission; +package cloud.commandframework.permission; import javax.annotation.Nonnull; import java.util.Collection; @@ -29,7 +29,7 @@ import java.util.Collections; import java.util.Objects; /** - * {@link com.intellectualsites.commands.arguments.CommandArgument} permission + * {@link cloud.commandframework.arguments.CommandArgument} permission */ public final class Permission implements CommandPermission { diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/permission/package-info.java b/cloud-core/src/main/java/cloud/commandframework/permission/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/permission/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/permission/package-info.java index 389dac02..38a75db2 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/permission/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/permission/package-info.java @@ -25,4 +25,4 @@ /** * Command permissions */ -package com.intellectualsites.commands.permission; +package cloud.commandframework.permission; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Pair.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Pair.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Pair.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Pair.java index 963d4831..450164e1 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Pair.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Pair.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import com.google.common.base.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quartet.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Quartet.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quartet.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Quartet.java index 134df02b..ad925415 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quartet.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Quartet.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import com.google.common.base.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quintet.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Quintet.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quintet.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Quintet.java index 55997cc8..7b60a80b 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Quintet.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Quintet.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import com.google.common.base.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Sextet.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Sextet.java similarity index 99% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Sextet.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Sextet.java index 4832a8b7..334b1101 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Sextet.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Sextet.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import com.google.common.base.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Triplet.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Triplet.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Triplet.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Triplet.java index 0c0f89b9..0b83798d 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Triplet.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Triplet.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import com.google.common.base.Objects; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuples.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuples.java similarity index 98% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuples.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuples.java index 47eb1481..ef20d417 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/Tuples.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/Tuples.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; import javax.annotation.Nonnull; diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/package-info.java b/cloud-core/src/main/java/cloud/commandframework/types/tuples/package-info.java similarity index 95% rename from cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/package-info.java rename to cloud-core/src/main/java/cloud/commandframework/types/tuples/package-info.java index 4c45dd33..f3883251 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/types/tuples/package-info.java +++ b/cloud-core/src/main/java/cloud/commandframework/types/tuples/package-info.java @@ -26,4 +26,4 @@ * Generic immutable n-tuples with non-null values * for 1 < n ≥ 6 */ -package com.intellectualsites.commands.types.tuples; +package cloud.commandframework.types.tuples; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandHelpHandlerTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java similarity index 96% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandHelpHandlerTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java index 7e62270a..ee6778ba 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandHelpHandlerTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandHelpHandlerTest.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.meta.SimpleCommandMeta; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPerformanceTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandPerformanceTest.java similarity index 95% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandPerformanceTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandPerformanceTest.java index eff575f4..df82ce7e 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPerformanceTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandPerformanceTest.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.execution.CommandResult; +import cloud.commandframework.execution.CommandResult; +import cloud.commandframework.context.CommandContext; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPermissionTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandPermissionTest.java similarity index 92% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandPermissionTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandPermissionTest.java index ba968d80..c205cadb 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPermissionTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandPermissionTest.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPostProcessorTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandPostProcessorTest.java similarity index 86% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandPostProcessorTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandPostProcessorTest.java index 5bd9f3ef..d6abff92 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPostProcessorTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandPostProcessorTest.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessingContext; -import com.intellectualsites.commands.execution.postprocessor.CommandPostprocessor; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.services.types.ConsumerService; +import cloud.commandframework.execution.postprocessor.CommandPostprocessingContext; +import cloud.commandframework.execution.postprocessor.CommandPostprocessor; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.services.types.ConsumerService; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPreProcessorTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandPreProcessorTest.java similarity index 89% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandPreProcessorTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandPreProcessorTest.java index b865c4c8..9d5b92e2 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandPreProcessorTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandPreProcessorTest.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.standard.EnumArgument; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessingContext; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessor; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.services.types.ConsumerService; +import cloud.commandframework.arguments.standard.EnumArgument; +import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; +import cloud.commandframework.execution.preprocessor.CommandPreprocessor; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.services.types.ConsumerService; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandSuggestionsTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java similarity index 95% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandSuggestionsTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java index c52325c4..aa495a75 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandSuggestionsTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandSuggestionsTest.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.standard.EnumArgument; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.arguments.standard.StringArgument; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.arguments.standard.EnumArgument; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandTest.java similarity index 91% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandTest.java index 3487fe52..cab955de 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandTest.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.meta.SimpleCommandMeta; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/CommandTreeTest.java b/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java similarity index 95% rename from cloud-core/src/test/java/com/intellectualsites/commands/CommandTreeTest.java rename to cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java index 4e5f2141..9d1ff6ec 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/CommandTreeTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/CommandTreeTest.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.arguments.standard.StringArgument; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.meta.SimpleCommandMeta; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/ExecutionBenchmark.java b/cloud-core/src/test/java/cloud/commandframework/ExecutionBenchmark.java similarity index 98% rename from cloud-core/src/test/java/com/intellectualsites/commands/ExecutionBenchmark.java rename to cloud-core/src/test/java/cloud/commandframework/ExecutionBenchmark.java index 7feaccc7..d61d5b0a 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/ExecutionBenchmark.java +++ b/cloud-core/src/test/java/cloud/commandframework/ExecutionBenchmark.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/ParserRegistryTest.java b/cloud-core/src/test/java/cloud/commandframework/ParserRegistryTest.java similarity index 86% rename from cloud-core/src/test/java/com/intellectualsites/commands/ParserRegistryTest.java rename to cloud-core/src/test/java/cloud/commandframework/ParserRegistryTest.java index 8c707554..a1075bfe 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/ParserRegistryTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/ParserRegistryTest.java @@ -21,16 +21,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.arguments.standard.IntegerArgument; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.parser.ParserParameters; -import com.intellectualsites.commands.arguments.parser.ParserRegistry; -import com.intellectualsites.commands.arguments.parser.StandardParameters; -import com.intellectualsites.commands.arguments.parser.StandardParserRegistry; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.parser.ParserParameters; +import cloud.commandframework.arguments.parser.ParserRegistry; +import cloud.commandframework.arguments.parser.StandardParameters; +import cloud.commandframework.arguments.parser.StandardParserRegistry; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/TestCommandManager.java b/cloud-core/src/test/java/cloud/commandframework/TestCommandManager.java similarity index 88% rename from cloud-core/src/test/java/com/intellectualsites/commands/TestCommandManager.java rename to cloud-core/src/test/java/cloud/commandframework/TestCommandManager.java index 8cad0e5f..c4ea7cb1 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/TestCommandManager.java +++ b/cloud-core/src/test/java/cloud/commandframework/TestCommandManager.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.internal.CommandRegistrationHandler; +import cloud.commandframework.meta.SimpleCommandMeta; import javax.annotation.Nonnull; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/TestCommandSender.java b/cloud-core/src/test/java/cloud/commandframework/TestCommandSender.java similarity index 96% rename from cloud-core/src/test/java/com/intellectualsites/commands/TestCommandSender.java rename to cloud-core/src/test/java/cloud/commandframework/TestCommandSender.java index f671f192..8cc802c5 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/TestCommandSender.java +++ b/cloud-core/src/test/java/cloud/commandframework/TestCommandSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; public class TestCommandSender { diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/arguments/standard/StringArgumentTest.java b/cloud-core/src/test/java/cloud/commandframework/arguments/standard/StringArgumentTest.java similarity index 94% rename from cloud-core/src/test/java/com/intellectualsites/commands/arguments/standard/StringArgumentTest.java rename to cloud-core/src/test/java/cloud/commandframework/arguments/standard/StringArgumentTest.java index cdbbd270..97d1465a 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/arguments/standard/StringArgumentTest.java +++ b/cloud-core/src/test/java/cloud/commandframework/arguments/standard/StringArgumentTest.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.arguments.standard; +package cloud.commandframework.arguments.standard; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.TestCommandManager; -import com.intellectualsites.commands.TestCommandSender; +import cloud.commandframework.CommandManager; +import cloud.commandframework.TestCommandManager; +import cloud.commandframework.TestCommandSender; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/cloud-core/src/test/java/com/intellectualsites/commands/package-info.java b/cloud-core/src/test/java/cloud/commandframework/package-info.java similarity index 96% rename from cloud-core/src/test/java/com/intellectualsites/commands/package-info.java rename to cloud-core/src/test/java/cloud/commandframework/package-info.java index e696a342..93abfa4d 100644 --- a/cloud-core/src/test/java/com/intellectualsites/commands/package-info.java +++ b/cloud-core/src/test/java/cloud/commandframework/package-info.java @@ -25,4 +25,4 @@ /** * Command tests */ -package com.intellectualsites.commands; +package cloud.commandframework; diff --git a/cloud-jline/pom.xml b/cloud-jline/pom.xml index 5f95974b..6600c76b 100644 --- a/cloud-jline/pom.xml +++ b/cloud-jline/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT @@ -19,7 +19,7 @@ 3.16.0 - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandManager.java b/cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandManager.java similarity index 92% rename from cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandManager.java rename to cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandManager.java index 8512a20d..319eb46a 100644 --- a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandManager.java +++ b/cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandManager.java @@ -21,17 +21,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.jline; +package cloud.commandframework.jline; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoSuchCommandException; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.internal.CommandRegistrationHandler; +import cloud.commandframework.meta.SimpleCommandMeta; import org.jline.reader.Candidate; import org.jline.reader.Completer; import org.jline.reader.LineReader; diff --git a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandSender.java b/cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandSender.java similarity index 96% rename from cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandSender.java rename to cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandSender.java index 4750b4d2..bd22214e 100644 --- a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/JLineCommandSender.java +++ b/cloud-jline/src/main/java/cloud/commandframework/jline/JLineCommandSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.jline; +package cloud.commandframework.jline; public class JLineCommandSender { diff --git a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/package-info.java b/cloud-jline/src/main/java/cloud/commandframework/jline/package-info.java similarity index 96% rename from cloud-jline/src/main/java/com/intellectualsites/commands/jline/package-info.java rename to cloud-jline/src/main/java/cloud/commandframework/jline/package-info.java index 9e8c597b..daabe895 100644 --- a/cloud-jline/src/main/java/com/intellectualsites/commands/jline/package-info.java +++ b/cloud-jline/src/main/java/cloud/commandframework/jline/package-info.java @@ -25,4 +25,4 @@ /** * cloud implementation for JLine3 */ -package com.intellectualsites.commands.jline; +package cloud.commandframework.jline; diff --git a/cloud-minecraft/README.md b/cloud-minecraft/README.md index a09bd218..53ba8340 100644 --- a/cloud-minecraft/README.md +++ b/cloud-minecraft/README.md @@ -16,7 +16,7 @@ Bukkit mappings for cloud. If `commodore` is present on the classpath and the se ### dependency ```xml - com.intellectualsites + cloud.commandframework cloud-bukkit 0.2.0-SNAPSHOT @@ -63,7 +63,7 @@ An example plugin using the `cloud-paper` API can be found [here](https://github ### dependency ```xml - com.intellectualsites + cloud.commandframework cloud-paper 0.2.0-SNAPSHOT @@ -78,7 +78,7 @@ BungeeCord mappings for cloud. ### dependency ```xml - com.intellectualsites + cloud.commandframework cloud-bungee 0.2.0-SNAPSHOT @@ -101,7 +101,7 @@ An example plugin using the `cloud-velocity` API can be found [here](https://git ### dependency ```xml - com.intellectualsites + cloud.commandframework cloud-velocity 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-brigadier/pom.xml b/cloud-minecraft/cloud-brigadier/pom.xml index 5d059338..790aa167 100644 --- a/cloud-minecraft/cloud-brigadier/pom.xml +++ b/cloud-minecraft/cloud-brigadier/pom.xml @@ -32,7 +32,7 @@ cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -50,7 +50,7 @@ - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/CloudBrigadierManager.java b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java similarity index 94% rename from cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/CloudBrigadierManager.java rename to cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java index 1790e34f..fccac364 100644 --- a/cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/CloudBrigadierManager.java +++ b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/CloudBrigadierManager.java @@ -21,27 +21,27 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.brigadier; +package cloud.commandframework.brigadier; import com.google.common.collect.Maps; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.arguments.standard.BooleanArgument; -import com.intellectualsites.commands.arguments.standard.ByteArgument; -import com.intellectualsites.commands.arguments.standard.DoubleArgument; -import com.intellectualsites.commands.arguments.standard.FloatArgument; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.arguments.standard.ShortArgument; -import com.intellectualsites.commands.arguments.standard.StringArgument; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.execution.preprocessor.CommandPreprocessingContext; -import com.intellectualsites.commands.permission.CommandPermission; -import com.intellectualsites.commands.permission.Permission; +import cloud.commandframework.Command; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.standard.BooleanArgument; +import cloud.commandframework.arguments.standard.ByteArgument; +import cloud.commandframework.arguments.standard.DoubleArgument; +import cloud.commandframework.arguments.standard.FloatArgument; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.standard.ShortArgument; +import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext; +import cloud.commandframework.permission.CommandPermission; +import cloud.commandframework.permission.Permission; import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.arguments.BoolArgumentType; diff --git a/cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/package-info.java b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/package-info.java similarity index 95% rename from cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/package-info.java rename to cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/package-info.java index b562ef9b..324bbfe0 100644 --- a/cloud-minecraft/cloud-brigadier/src/main/java/com/intellectualsites/commands/brigadier/package-info.java +++ b/cloud-minecraft/cloud-brigadier/src/main/java/cloud/commandframework/brigadier/package-info.java @@ -25,4 +25,4 @@ /** * Brigadier mappings */ -package com.intellectualsites.commands.brigadier; +package cloud.commandframework.brigadier; diff --git a/cloud-minecraft/cloud-bukkit-test/pom.xml b/cloud-minecraft/cloud-bukkit-test/pom.xml index 02fcb886..98498ca8 100644 --- a/cloud-minecraft/cloud-bukkit-test/pom.xml +++ b/cloud-minecraft/cloud-bukkit-test/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -73,7 +73,7 @@ - com.intellectualsites + cloud.commandframework cloud-paper 0.2.0-SNAPSHOT @@ -84,7 +84,7 @@ provided - com.intellectualsites + cloud.commandframework cloud-annotations 0.2.0-SNAPSHOT @@ -94,7 +94,7 @@ 1.9 - com.intellectualsites + cloud.commandframework cloud-minecraft-extras 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/BukkitTest.java b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java similarity index 87% rename from cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/BukkitTest.java rename to cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java index 34b93098..5d1d9063 100644 --- a/cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/BukkitTest.java +++ b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/BukkitTest.java @@ -21,33 +21,33 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.annotations.AnnotationParser; -import com.intellectualsites.commands.annotations.Argument; -import com.intellectualsites.commands.annotations.CommandMethod; -import com.intellectualsites.commands.annotations.Confirmation; -import com.intellectualsites.commands.annotations.CommandDescription; -import com.intellectualsites.commands.annotations.specifier.Completions; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.StandardParameters; -import com.intellectualsites.commands.arguments.standard.BooleanArgument; -import com.intellectualsites.commands.arguments.standard.DoubleArgument; -import com.intellectualsites.commands.arguments.standard.EnumArgument; -import com.intellectualsites.commands.arguments.standard.FloatArgument; -import com.intellectualsites.commands.arguments.standard.IntegerArgument; -import com.intellectualsites.commands.arguments.standard.StringArgument; -import com.intellectualsites.commands.bukkit.BukkitCommandManager; -import com.intellectualsites.commands.bukkit.BukkitCommandMetaBuilder; -import com.intellectualsites.commands.bukkit.CloudBukkitCapabilities; -import com.intellectualsites.commands.bukkit.parsers.WorldArgument; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.execution.AsynchronousCommandExecutionCoordinator; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.extra.confirmation.CommandConfirmationManager; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.commands.paper.PaperCommandManager; +import cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator; +import cloud.commandframework.extra.confirmation.CommandConfirmationManager; +import cloud.commandframework.annotations.AnnotationParser; +import cloud.commandframework.annotations.Argument; +import cloud.commandframework.annotations.CommandMethod; +import cloud.commandframework.annotations.Confirmation; +import cloud.commandframework.annotations.CommandDescription; +import cloud.commandframework.annotations.specifier.Completions; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.StandardParameters; +import cloud.commandframework.arguments.standard.BooleanArgument; +import cloud.commandframework.arguments.standard.DoubleArgument; +import cloud.commandframework.arguments.standard.EnumArgument; +import cloud.commandframework.arguments.standard.FloatArgument; +import cloud.commandframework.arguments.standard.IntegerArgument; +import cloud.commandframework.arguments.standard.StringArgument; +import cloud.commandframework.bukkit.BukkitCommandManager; +import cloud.commandframework.bukkit.BukkitCommandMetaBuilder; +import cloud.commandframework.bukkit.CloudBukkitCapabilities; +import cloud.commandframework.bukkit.parsers.WorldArgument; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.paper.PaperCommandManager; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import org.bukkit.Bukkit; import org.bukkit.ChatColor; diff --git a/cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/package-info.java b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/package-info.java similarity index 96% rename from cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/package-info.java rename to cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/package-info.java index 316be661..bad3a9a4 100644 --- a/cloud-minecraft/cloud-bukkit-test/src/main/java/com/intellectualsites/commands/package-info.java +++ b/cloud-minecraft/cloud-bukkit-test/src/main/java/cloud/commandframework/package-info.java @@ -25,4 +25,4 @@ /** * Stuff */ -package com.intellectualsites.commands; +package cloud.commandframework; diff --git a/cloud-minecraft/cloud-bukkit-test/src/main/resources/plugin.yml b/cloud-minecraft/cloud-bukkit-test/src/main/resources/plugin.yml index ed22e731..0c4291cf 100644 --- a/cloud-minecraft/cloud-bukkit-test/src/main/resources/plugin.yml +++ b/cloud-minecraft/cloud-bukkit-test/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: Command-Test author: Citymonstret -main: com.intellectualsites.commands.BukkitTest +main: cloud.commandframework.BukkitTest version: 1.0 api-version: 1.13 diff --git a/cloud-minecraft/cloud-bukkit/pom.xml b/cloud-minecraft/cloud-bukkit/pom.xml index f3d8c4a9..2a95c3b7 100644 --- a/cloud-minecraft/cloud-bukkit/pom.xml +++ b/cloud-minecraft/cloud-bukkit/pom.xml @@ -31,7 +31,7 @@ ../../ cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT @@ -54,12 +54,12 @@ provided - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT - com.intellectualsites + cloud.commandframework cloud-brigadier 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommand.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommand.java similarity index 94% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommand.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommand.java index de8fa009..ad3cf8b3 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommand.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommand.java @@ -21,15 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.exceptions.ArgumentParseException; -import com.intellectualsites.commands.exceptions.InvalidCommandSenderException; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.exceptions.ArgumentParseException; +import cloud.commandframework.exceptions.InvalidCommandSenderException; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.exceptions.NoSuchCommandException; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginIdentifiableCommand; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandManager.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandManager.java similarity index 96% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandManager.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandManager.java index 271887b5..10258830 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandManager.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandManager.java @@ -21,14 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.bukkit.parsers.MaterialArgument; +import cloud.commandframework.bukkit.parsers.WorldArgument; +import cloud.commandframework.execution.CommandExecutionCoordinator; import com.google.common.reflect.TypeToken; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.bukkit.parsers.MaterialArgument; -import com.intellectualsites.commands.bukkit.parsers.WorldArgument; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.World; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMeta.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMeta.java similarity index 93% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMeta.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMeta.java index 281786bb..e918f5c6 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMeta.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMeta.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; import javax.annotation.Nonnull; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMetaBuilder.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMetaBuilder.java similarity index 95% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMetaBuilder.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMetaBuilder.java index cb47c508..d77b0e9e 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandMetaBuilder.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandMetaBuilder.java @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; -import com.intellectualsites.commands.meta.CommandMeta; +import cloud.commandframework.meta.CommandMeta; import javax.annotation.Nonnull; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandSender.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandSender.java similarity index 98% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandSender.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandSender.java index 9c4116ad..1a022b64 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitCommandSender.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommandSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; import com.google.common.base.Objects; import org.bukkit.entity.Player; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitConsoleSender.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitConsoleSender.java similarity index 97% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitConsoleSender.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitConsoleSender.java index 9cda9525..330c06cb 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitConsoleSender.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitConsoleSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPlayerSender.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPlayerSender.java similarity index 97% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPlayerSender.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPlayerSender.java index 53be9e3c..9f15bf7e 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPlayerSender.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPlayerSender.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; import org.bukkit.entity.Player; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPluginRegistrationHandler.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java similarity index 94% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPluginRegistrationHandler.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java index e14605ec..26bc877a 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/BukkitPluginRegistrationHandler.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.internal.CommandRegistrationHandler; import org.bukkit.Bukkit; import org.bukkit.command.CommandMap; import org.bukkit.command.SimpleCommandMap; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudBukkitCapabilities.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudBukkitCapabilities.java similarity index 96% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudBukkitCapabilities.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudBukkitCapabilities.java index 6a8ebcfb..e9619c53 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudBukkitCapabilities.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudBukkitCapabilities.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; /** * Capabilities for the Bukkit module diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudCommodoreManager.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudCommodoreManager.java similarity index 93% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudCommodoreManager.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudCommodoreManager.java index dc632418..df4a0ff6 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/CloudCommodoreManager.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/CloudCommodoreManager.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.brigadier.CloudBrigadierManager; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.Command; +import cloud.commandframework.brigadier.CloudBrigadierManager; +import cloud.commandframework.context.CommandContext; import com.mojang.brigadier.tree.LiteralCommandNode; import me.lucko.commodore.Commodore; import me.lucko.commodore.CommodoreProvider; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/package-info.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/package-info.java similarity index 96% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/package-info.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/package-info.java index ea8415f2..54f93233 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/package-info.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/package-info.java @@ -25,4 +25,4 @@ /** * cloud implementation for Bukkit 1.8-1.16 */ -package com.intellectualsites.commands.bukkit; +package cloud.commandframework.bukkit; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/MaterialArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java similarity index 94% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/MaterialArgument.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java index cd6e84de..ad109367 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/MaterialArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/MaterialArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit.parsers; +package cloud.commandframework.bukkit.parsers; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.context.CommandContext; import org.bukkit.Material; import javax.annotation.Nonnull; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/WorldArgument.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java similarity index 94% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/WorldArgument.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java index 8c6e5e33..09fb6fba 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/WorldArgument.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/WorldArgument.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bukkit.parsers; +package cloud.commandframework.bukkit.parsers; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.parser.ArgumentParseResult; -import com.intellectualsites.commands.arguments.parser.ArgumentParser; -import com.intellectualsites.commands.context.CommandContext; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.parser.ArgumentParseResult; +import cloud.commandframework.arguments.parser.ArgumentParser; +import cloud.commandframework.context.CommandContext; import org.bukkit.Bukkit; import org.bukkit.World; diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/package-info.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/package-info.java similarity index 95% rename from cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/package-info.java rename to cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/package-info.java index a13f91aa..6aac144b 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/com/intellectualsites/commands/bukkit/parsers/package-info.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/parsers/package-info.java @@ -25,4 +25,4 @@ /** * Bukkit specific command arguments */ -package com.intellectualsites.commands.bukkit.parsers; +package cloud.commandframework.bukkit.parsers; diff --git a/cloud-minecraft/cloud-bungee/pom.xml b/cloud-minecraft/cloud-bungee/pom.xml index 661ee0a1..276a4dce 100644 --- a/cloud-minecraft/cloud-bungee/pom.xml +++ b/cloud-minecraft/cloud-bungee/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -54,7 +54,7 @@ provided - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommand.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommand.java similarity index 92% rename from cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommand.java rename to cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommand.java index fad715b6..ea20b493 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommand.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommand.java @@ -21,15 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bungee; +package cloud.commandframework.bungee; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.exceptions.ArgumentParseException; -import com.intellectualsites.commands.exceptions.InvalidCommandSenderException; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.exceptions.ArgumentParseException; +import cloud.commandframework.exceptions.InvalidCommandSenderException; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.exceptions.NoSuchCommandException; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.chat.ComponentBuilder; @@ -48,10 +48,10 @@ public final class BungeeCommand extends Command implements TabExecutor { private final BungeeCommandManager manager; private final CommandArgument command; - private final com.intellectualsites.commands.Command cloudCommand; + private final cloud.commandframework.Command cloudCommand; @SuppressWarnings("unchecked") - BungeeCommand(@Nonnull final com.intellectualsites.commands.Command cloudCommand, + BungeeCommand(@Nonnull final cloud.commandframework.Command cloudCommand, @Nonnull final CommandArgument command, @Nonnull final BungeeCommandManager manager) { super(command.getName(), diff --git a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommandManager.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommandManager.java similarity index 92% rename from cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommandManager.java rename to cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommandManager.java index 87fb0954..f5d884ad 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeeCommandManager.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeeCommandManager.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bungee; +package cloud.commandframework.bungee; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.SimpleCommandMeta; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Plugin; diff --git a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeePluginRegistrationHandler.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeePluginRegistrationHandler.java similarity index 91% rename from cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeePluginRegistrationHandler.java rename to cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeePluginRegistrationHandler.java index 95343ef4..5e9c225f 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/BungeePluginRegistrationHandler.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/BungeePluginRegistrationHandler.java @@ -21,11 +21,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.bungee; +package cloud.commandframework.bungee; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.internal.CommandRegistrationHandler; import javax.annotation.Nonnull; import java.util.HashMap; diff --git a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/package-info.java b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/package-info.java similarity index 96% rename from cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/package-info.java rename to cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/package-info.java index acb1f595..f4246c73 100644 --- a/cloud-minecraft/cloud-bungee/src/main/java/com/intellectualsites/commands/bungee/package-info.java +++ b/cloud-minecraft/cloud-bungee/src/main/java/cloud/commandframework/bungee/package-info.java @@ -25,4 +25,4 @@ /** * BungeeCord implementation of cloud */ -package com.intellectualsites.commands.bungee; +package cloud.commandframework.bungee; diff --git a/cloud-minecraft/cloud-cloudburst-test/pom.xml b/cloud-minecraft/cloud-cloudburst-test/pom.xml index 2b411179..4cfd2ff0 100644 --- a/cloud-minecraft/cloud-cloudburst-test/pom.xml +++ b/cloud-minecraft/cloud-cloudburst-test/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -73,12 +73,12 @@ - com.intellectualsites + cloud.commandframework cloud-cloudburst 0.2.0-SNAPSHOT - com.intellectualsites + cloud.commandframework cloud-annotations 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/CloudCloudburstTest.java b/cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/CloudCloudburstTest.java similarity index 86% rename from cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/CloudCloudburstTest.java rename to cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/CloudCloudburstTest.java index 298acbd1..03bdad17 100644 --- a/cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/CloudCloudburstTest.java +++ b/cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/CloudCloudburstTest.java @@ -21,14 +21,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; -import com.intellectualsites.commands.annotations.AnnotationParser; -import com.intellectualsites.commands.annotations.Argument; -import com.intellectualsites.commands.annotations.CommandMethod; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.annotations.AnnotationParser; +import cloud.commandframework.annotations.Argument; +import cloud.commandframework.annotations.CommandMethod; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.SimpleCommandMeta; import org.cloudburstmc.server.command.CommandSender; import org.cloudburstmc.server.plugin.PluginBase; import org.cloudburstmc.server.utils.TextFormat; diff --git a/cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java b/cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/package-info.java similarity index 95% rename from cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java rename to cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/package-info.java index cfc51c7f..a24c4ecc 100644 --- a/cloud-minecraft/cloud-cloudburst-test/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java +++ b/cloud-minecraft/cloud-cloudburst-test/src/main/java/cloud/commandframework/cloudburst/package-info.java @@ -25,4 +25,4 @@ /** * Cloudburst test plugin */ -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; diff --git a/cloud-minecraft/cloud-cloudburst-test/src/main/resources/plugin.yml b/cloud-minecraft/cloud-cloudburst-test/src/main/resources/plugin.yml index 30a5cfd6..5b609eee 100644 --- a/cloud-minecraft/cloud-cloudburst-test/src/main/resources/plugin.yml +++ b/cloud-minecraft/cloud-cloudburst-test/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: CloudTest -main: com.intellectualsites.commands.cloudburst.CloudCloudburstTest +main: cloud.commandframework.cloudburst.CloudCloudburstTest version: 0.2.0-SNAPSHOT load: POSTWORLD api: ["2.0.0"] diff --git a/cloud-minecraft/cloud-cloudburst/pom.xml b/cloud-minecraft/cloud-cloudburst/pom.xml index c90fec39..7fe90b75 100644 --- a/cloud-minecraft/cloud-cloudburst/pom.xml +++ b/cloud-minecraft/cloud-cloudburst/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -58,7 +58,7 @@ provided - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommand.java b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommand.java similarity index 91% rename from cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommand.java rename to cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommand.java index af45d20a..eb9a5db2 100644 --- a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommand.java +++ b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommand.java @@ -21,14 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.exceptions.ArgumentParseException; -import com.intellectualsites.commands.exceptions.InvalidCommandSenderException; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; +import cloud.commandframework.Command; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.exceptions.ArgumentParseException; +import cloud.commandframework.exceptions.InvalidCommandSenderException; +import cloud.commandframework.exceptions.NoSuchCommandException; import org.cloudburstmc.server.command.CommandSender; import org.cloudburstmc.server.command.PluginCommand; import org.cloudburstmc.server.command.data.CommandData; @@ -47,11 +48,11 @@ final class CloudburstCommand extends PluginCommand { private final CommandArgument command; private final CloudburstCommandManager manager; - private final com.intellectualsites.commands.Command cloudCommand; + private final Command cloudCommand; CloudburstCommand(@Nonnull final String label, @Nonnull final List aliases, - @Nonnull final com.intellectualsites.commands.Command cloudCommand, + @Nonnull final Command cloudCommand, @Nonnull final CommandArgument command, @Nonnull final CloudburstCommandManager manager) { super(manager.getOwningPlugin(), CommandData.builder(label) diff --git a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommandManager.java b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommandManager.java similarity index 91% rename from cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommandManager.java rename to cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommandManager.java index d048854e..c6874c4a 100644 --- a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstCommandManager.java +++ b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstCommandManager.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; import org.cloudburstmc.server.command.CommandSender; import org.cloudburstmc.server.plugin.Plugin; diff --git a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstPluginRegistrationHandler.java b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstPluginRegistrationHandler.java similarity index 90% rename from cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstPluginRegistrationHandler.java rename to cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstPluginRegistrationHandler.java index 25c1f4ab..a988a2ad 100644 --- a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/CloudburstPluginRegistrationHandler.java +++ b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/CloudburstPluginRegistrationHandler.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.internal.CommandRegistrationHandler; import org.cloudburstmc.server.Server; import org.cloudburstmc.server.plugin.Plugin; diff --git a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/package-info.java similarity index 95% rename from cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java rename to cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/package-info.java index 02be0f9c..9e4cb4ff 100644 --- a/cloud-minecraft/cloud-cloudburst/src/main/java/com/intellectualsites/commands/cloudburst/package-info.java +++ b/cloud-minecraft/cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst/package-info.java @@ -25,4 +25,4 @@ /** * Cloudburst implementation of Cloud */ -package com.intellectualsites.commands.cloudburst; +package cloud.commandframework.cloudburst; diff --git a/cloud-minecraft/cloud-minecraft-extras/pom.xml b/cloud-minecraft/cloud-minecraft-extras/pom.xml index 4b0d735b..15b16298 100644 --- a/cloud-minecraft/cloud-minecraft-extras/pom.xml +++ b/cloud-minecraft/cloud-minecraft-extras/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -53,7 +53,7 @@ 4.0.0-SNAPSHOT - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/AudienceProvider.java b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/AudienceProvider.java similarity index 97% rename from cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/AudienceProvider.java rename to cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/AudienceProvider.java index 824da19d..472911b9 100644 --- a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/AudienceProvider.java +++ b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/AudienceProvider.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; import net.kyori.adventure.audience.Audience; diff --git a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/MinecraftHelp.java b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/MinecraftHelp.java similarity index 98% rename from cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/MinecraftHelp.java rename to cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/MinecraftHelp.java index c796b959..27371bb1 100644 --- a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/MinecraftHelp.java +++ b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/MinecraftHelp.java @@ -21,10 +21,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands; +package cloud.commandframework; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; import net.kyori.adventure.audience.Audience; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.Template; diff --git a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/package-info.java b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/package-info.java similarity index 96% rename from cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/package-info.java rename to cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/package-info.java index 8e491fbc..d3b57ce9 100644 --- a/cloud-minecraft/cloud-minecraft-extras/src/main/java/com/intellectualsites/commands/package-info.java +++ b/cloud-minecraft/cloud-minecraft-extras/src/main/java/cloud/commandframework/package-info.java @@ -25,4 +25,4 @@ /** * Minecraft extras */ -package com.intellectualsites.commands; +package cloud.commandframework; diff --git a/cloud-minecraft/cloud-paper/pom.xml b/cloud-minecraft/cloud-paper/pom.xml index 011811c5..b7602541 100644 --- a/cloud-minecraft/cloud-paper/pom.xml +++ b/cloud-minecraft/cloud-paper/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -48,7 +48,7 @@ - com.intellectualsites + cloud.commandframework cloud-bukkit 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/AsyncCommandSuggestionsListener.java b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/AsyncCommandSuggestionsListener.java similarity index 98% rename from cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/AsyncCommandSuggestionsListener.java rename to cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/AsyncCommandSuggestionsListener.java index 0198d423..ad554ee3 100644 --- a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/AsyncCommandSuggestionsListener.java +++ b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/AsyncCommandSuggestionsListener.java @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.paper; +package cloud.commandframework.paper; import com.destroystokyo.paper.event.server.AsyncTabCompleteEvent; import org.bukkit.command.CommandSender; diff --git a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperBrigadierListener.java b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperBrigadierListener.java similarity index 94% rename from cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperBrigadierListener.java rename to cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperBrigadierListener.java index 6b3f39cc..18d5f00f 100644 --- a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperBrigadierListener.java +++ b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperBrigadierListener.java @@ -21,15 +21,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.paper; +package cloud.commandframework.paper; +import cloud.commandframework.brigadier.CloudBrigadierManager; import com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource; import com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.brigadier.CloudBrigadierManager; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.permission.CommandPermission; +import cloud.commandframework.CommandTree; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.permission.CommandPermission; import com.mojang.brigadier.arguments.ArgumentType; import org.bukkit.Bukkit; import org.bukkit.Material; diff --git a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperCommandManager.java b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperCommandManager.java similarity index 92% rename from cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperCommandManager.java rename to cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperCommandManager.java index 098b086f..9ab4fde1 100644 --- a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/PaperCommandManager.java +++ b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/PaperCommandManager.java @@ -21,12 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.paper; +package cloud.commandframework.paper; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.bukkit.BukkitCommandManager; -import com.intellectualsites.commands.bukkit.CloudBukkitCapabilities; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; +import cloud.commandframework.CommandTree; +import cloud.commandframework.bukkit.BukkitCommandManager; +import cloud.commandframework.bukkit.CloudBukkitCapabilities; +import cloud.commandframework.execution.CommandExecutionCoordinator; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; diff --git a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/package-info.java b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/package-info.java similarity index 96% rename from cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/package-info.java rename to cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/package-info.java index b6279446..f493a090 100644 --- a/cloud-minecraft/cloud-paper/src/main/java/com/intellectualsites/commands/paper/package-info.java +++ b/cloud-minecraft/cloud-paper/src/main/java/cloud/commandframework/paper/package-info.java @@ -25,4 +25,4 @@ /** * Paper specific implementation that extends the Bukkit implementation */ -package com.intellectualsites.commands.paper; +package cloud.commandframework.paper; diff --git a/cloud-minecraft/cloud-velocity-test/pom.xml b/cloud-minecraft/cloud-velocity-test/pom.xml index 06741b54..6c47b309 100644 --- a/cloud-minecraft/cloud-velocity-test/pom.xml +++ b/cloud-minecraft/cloud-velocity-test/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -207,12 +207,12 @@ provided - com.intellectualsites + cloud.commandframework cloud-velocity 0.2.0-SNAPSHOT - com.intellectualsites + cloud.commandframework cloud-annotations 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/CloudVelocityTest.java b/cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/CloudVelocityTest.java similarity index 88% rename from cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/CloudVelocityTest.java rename to cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/CloudVelocityTest.java index fb56b341..ebcf8913 100644 --- a/cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/CloudVelocityTest.java +++ b/cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/CloudVelocityTest.java @@ -21,16 +21,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.cloudvelocitytest; +package cloud.commandframework.cloudvelocitytest; import com.google.inject.Inject; -import com.intellectualsites.commands.annotations.AnnotationParser; -import com.intellectualsites.commands.annotations.Argument; -import com.intellectualsites.commands.annotations.CommandMethod; -import com.intellectualsites.commands.annotations.specifier.Range; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.SimpleCommandMeta; -import com.intellectualsites.commands.velocity.VelocityCommandManager; +import cloud.commandframework.annotations.AnnotationParser; +import cloud.commandframework.annotations.Argument; +import cloud.commandframework.annotations.CommandMethod; +import cloud.commandframework.annotations.specifier.Range; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.SimpleCommandMeta; +import cloud.commandframework.velocity.VelocityCommandManager; import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; diff --git a/cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/package-info.java b/cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/package-info.java similarity index 95% rename from cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/package-info.java rename to cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/package-info.java index a7782d6b..97858bd1 100644 --- a/cloud-minecraft/cloud-velocity-test/src/main/java/com/intellectualsites/cloudvelocitytest/package-info.java +++ b/cloud-minecraft/cloud-velocity-test/src/main/java/cloud/commandframework/cloudvelocitytest/package-info.java @@ -25,4 +25,4 @@ /** * Velocity test plugin */ -package com.intellectualsites.cloudvelocitytest; +package cloud.commandframework.cloudvelocitytest; diff --git a/cloud-minecraft/cloud-velocity/pom.xml b/cloud-minecraft/cloud-velocity/pom.xml index 839a7ca6..86eab792 100644 --- a/cloud-minecraft/cloud-velocity/pom.xml +++ b/cloud-minecraft/cloud-velocity/pom.xml @@ -30,7 +30,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> cloud - com.intellectualsites + cloud.commandframework 1.0-SNAPSHOT ../../pom.xml @@ -48,12 +48,12 @@ - com.intellectualsites + cloud.commandframework cloud-core 0.2.0-SNAPSHOT - com.intellectualsites + cloud.commandframework cloud-brigadier 0.2.0-SNAPSHOT diff --git a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityCommandManager.java b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityCommandManager.java similarity index 90% rename from cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityCommandManager.java rename to cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityCommandManager.java index 88848ef3..ce416e2a 100644 --- a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityCommandManager.java +++ b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityCommandManager.java @@ -21,13 +21,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.velocity; +package cloud.commandframework.velocity; -import com.intellectualsites.commands.CommandManager; -import com.intellectualsites.commands.CommandTree; -import com.intellectualsites.commands.execution.CommandExecutionCoordinator; -import com.intellectualsites.commands.meta.CommandMeta; -import com.intellectualsites.commands.meta.SimpleCommandMeta; +import cloud.commandframework.CommandManager; +import cloud.commandframework.CommandTree; +import cloud.commandframework.execution.CommandExecutionCoordinator; +import cloud.commandframework.meta.CommandMeta; +import cloud.commandframework.meta.SimpleCommandMeta; import com.velocitypowered.api.command.CommandSource; import com.velocitypowered.api.proxy.ProxyServer; diff --git a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityPluginRegistrationHandler.java b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityPluginRegistrationHandler.java similarity index 90% rename from cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityPluginRegistrationHandler.java rename to cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityPluginRegistrationHandler.java index 1dbbb425..7ec8d262 100644 --- a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/VelocityPluginRegistrationHandler.java +++ b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/VelocityPluginRegistrationHandler.java @@ -21,19 +21,19 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // -package com.intellectualsites.commands.velocity; +package cloud.commandframework.velocity; -import com.intellectualsites.commands.Command; -import com.intellectualsites.commands.arguments.CommandArgument; -import com.intellectualsites.commands.arguments.StaticArgument; -import com.intellectualsites.commands.brigadier.CloudBrigadierManager; -import com.intellectualsites.commands.context.CommandContext; -import com.intellectualsites.commands.exceptions.ArgumentParseException; -import com.intellectualsites.commands.exceptions.InvalidCommandSenderException; -import com.intellectualsites.commands.exceptions.InvalidSyntaxException; -import com.intellectualsites.commands.exceptions.NoPermissionException; -import com.intellectualsites.commands.exceptions.NoSuchCommandException; -import com.intellectualsites.commands.internal.CommandRegistrationHandler; +import cloud.commandframework.brigadier.CloudBrigadierManager; +import cloud.commandframework.Command; +import cloud.commandframework.arguments.CommandArgument; +import cloud.commandframework.arguments.StaticArgument; +import cloud.commandframework.context.CommandContext; +import cloud.commandframework.exceptions.ArgumentParseException; +import cloud.commandframework.exceptions.InvalidCommandSenderException; +import cloud.commandframework.exceptions.InvalidSyntaxException; +import cloud.commandframework.exceptions.NoPermissionException; +import cloud.commandframework.exceptions.NoSuchCommandException; +import cloud.commandframework.internal.CommandRegistrationHandler; import com.velocitypowered.api.command.BrigadierCommand; import com.velocitypowered.api.command.CommandMeta; import com.velocitypowered.api.command.CommandSource; diff --git a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/package-info.java b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/package-info.java similarity index 96% rename from cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/package-info.java rename to cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/package-info.java index f7086b3f..0ff17e32 100644 --- a/cloud-minecraft/cloud-velocity/src/main/java/com/intellectualsites/commands/velocity/package-info.java +++ b/cloud-minecraft/cloud-velocity/src/main/java/cloud/commandframework/velocity/package-info.java @@ -25,4 +25,4 @@ /** * Velocity implementation of cloud */ -package com.intellectualsites.commands.velocity; +package cloud.commandframework.velocity; diff --git a/cloud-services/LICENSE b/cloud-services/LICENSE new file mode 100644 index 00000000..becafcf5 --- /dev/null +++ b/cloud-services/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 IntellectualSites + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cloud-services/README.md b/cloud-services/README.md new file mode 100644 index 00000000..83fa75fd --- /dev/null +++ b/cloud-services/README.md @@ -0,0 +1,433 @@ +# Rörledning + +[![CodeFactor](https://www.codefactor.io/repository/github/sauilitired/rorledning/badge/master)](https://www.codefactor.io/repository/github/sauilitired/rorledning/overview/master) + +This is a library that allows you to create services, that can have several different implementations. +A service in this case, is anything that takes in a context, and spits out some sort of result, achieving +some pre-determined task. + +Examples of services would be generators and caches. + +## Links + +- Discord: https://discord.gg/KxkjDVg +- JavaDoc: https://plotsquared.com/docs/rörledning/ + +## Maven + +Rörledning is available from [IntellectualSites](https://intellectualsites.com)' maven repository: + +```xml + + intellectualsites-snapshots + https://mvn.intellectualsites.com/content/repositories/snapshots + +``` + +```xml + + cloud.commandframework + Pipeline + 1.4.0-SNAPSHOT + +``` + +## Usage + +### ServicePipeline + +All requests start in the `ServicePipeline`. To get an instance of the `ServicePipeline`, simply use +the service pipeline builder. + +**Example:** + +```java +final ServicePipeline servicePipeline = ServicePipeline.builder().build(); +``` + +### Service + +To implement a service, simply create an interface that extends `Service`. +The context is the type that gets pumped into the service (i.e, the value you provide), and the result +is the type that gets produced by the service. + +The pipeline will attempt to generate a result from each service, until a service produces a non-null result. +Thus, if a service cannot (or shouldn't) produce a result for a given context, it can simply return null. + +However, there's a catch to this. At least one service must always provide a result for every input. +To ensure that this is the case, a default implementation of the service must be registered together +with the service type. This implementation is not allowed to return null. + +**Examples:** + +Example Service: + +```java +public interface MockService extends Service { + + class MockContext { + + private final String string; + + public MockContext(@Nonnull final String string) { + this.string = string; + } + + @Nonnull public String getString() { + return this.string; + } + + } + + class MockResult { + + private final int integer; + + public MockResult(final int integer) { + this.integer = integer; + } + + public int getInteger() { + return this.integer; + } + + } + +} +``` + +Example Implementation: + +```java +public class DefaultMockService implements MockService { + + @Nullable @Override public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(32); + } + +} +``` + +Example Registration: + +```java +servicePipeline.registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); +``` + +Example Usage: + +```java +final int result = servicePipeline.pump(new MockService.MockContext("Hello")) + .through(MockService.class) + .getResult() + .getInteger(); +``` + +### SideEffectService + +Some services may just alter the state of the incoming context, without generating any (useful) result. +These services should extend `SideEffectService`. + +SideEffectService returns a State instead of a result. The service may either accept a context, in +which case the execution chain is interrupted. It can also reject the context, in which case the +other services in the execution chain will get a chance to consume it. + +**Example:** + +```java +public interface MockSideEffectService extends SideEffectService { + + class MockPlayer { + + private int health; + + public MockPlayer(final int health) { + this.health = health; + } + + public int getHealth() { + return this.health; + } + + public void setHealth(final int health) { + this.health = health; + } + + } + +} + +public class DefaultSideEffectService implements MockSideEffectService { + + @Nonnull @Override public State handle(@Nonnull final MockPlayer mockPlayer) { + mockPlayer.setHealth(0); + return State.ACCEPTED; + } + +} +``` + +### Asynchronous Execution + +The pipeline results can be evaluated asynchronously. Simple use `getResultAsynchronously()` +instead of `getResult()`. By default, a single threaded executor is used. A different executor +can be supplied to the pipeline builder. + +### Filters + +Sometimes you may not want your service to respond to certain contexts. Instead of always +returning null in those cases, filters can be used. These are simply predicates that take in your +context type, and should be registered together with your implementation. + +**Example:** + +Example Filter: +```java +public class FilteredMockService implements MockService, Predicate { + + @Nullable @Override public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(999); + } + + @Override public boolean test(final MockContext mockContext) { + return mockContext.getString().equalsIgnoreCase("potato"); + } + +} +``` + +Example Registration: + +```java +final FilteredMockService service = new FilteredMockService(); +final List> predicates = Collections.singletonList(service); +servicePipeline.registerServiceImplementation(MockService.class, service, predicates); +``` + +### Forwarding + +Sometimes it may be useful to use the result produced by a service as the context for another service. +To make this easier, the concept of forwarding was introduced. When using `getResult()`, one can instead +use `forward()`, to pump the result back into the pipeline. + +**Examples:** + +```java +servicePipeline.pump(new MockService.MockContext("huh")) + .through(MockService.class) + .forward() + .through(MockResultConsumer.class) + .getResult(); +``` + +This can also be done asynchronously: + +```java +servicePipeline.pump(new MockService.MockContext("Something")) + .through(MockService.class) + .forwardAsynchronously() + .thenApply(pump -> pump.through(MockResultConsumer.class)) + .thenApply(ServiceSpigot::getResult) + .get(); +``` + +### Priority/Ordering + +By default, all service implementations will be executed in first-in-last-out order. That is, +the earlier the implementation was registered, the lower the priority it gets in the execution chain. + +This may not always be ideal, and it is therefore possibly to override the natural ordering +of the implementations by using the @Optional annotation. + +**Example:** + +```java +@Order(ExecutionOrder.FIRST) +public class MockOrderedFirst implements MockService { + + @Nullable @Override public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(1); + } + +} + +@Order(ExecutionOrder.LAST) +public class MockOrderedLast implements MockService { + + @Nullable @Override public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(2); + } + +} +``` + +No matter in which order MockOrderedFirst and MockOrderedLast are added, MockOrderedFirst will be +handled before MockOrderedLast. + +The default order for all services is `SOON`. + +### Annotated Methods + +You can also implement services by using instance methods, like such: + +```java +@ServiceImplementation(MockService.class) +public MockService.MockResult handle(@Nonnull final MockService.MockContext context) { + return new MockService.MockResult(context.getString().length()); +} +``` + +The methods can also be annotated with the order annotation. Is is very important +that the method return type and parameter type match up wit the service context and +result types, or you will get runtime exceptions when using the pipeline. + +These methods are registered in ServicePipeline, using `registerMethods(yourClassInstance);` + +### ConsumerService + +Consumer services effectively turns the service pipeline into an event bus. Each implementation +will get a chance to consume the incoming context, unless an implementation forcefully interrupts +the execution, by calling `ConsumerService.interrupt()` + +**Examples:** + +```java +public interface MockConsumerService extends ConsumerService { +} + +public class InterruptingMockConsumer implements MockConsumerService { + + @Override public void accept(@Nonnull final MockService.MockContext mockContext) { + ConsumerService.interrupt(); + } + +} + +public class StateSettingConsumerService implements MockConsumerService { + + @Override public void accept(@Nonnull final MockService.MockContext mockContext) { + mockContext.setState(""); + } + +} +``` + +### Partial Result Services + +Sometimes you may need to get results for multiple contexts, but there is no guarantee +that a single service will be able to generate all the needed results. It is then possible +to make use of `PartialResultService`. + +The partial result service interface uses the `ChunkedRequestContext` class as the input, and +outputs a map of request-response pairs. + +**Example:** + +Example Request Type: + +```java +public class MockChunkedRequest extends ChunkedRequestContext { + + public MockChunkedRequest(@Nonnull final Collection requests) { + super(requests); + } + + + public static class Animal { + + private final String name; + + public Animal(@Nonnull final String name) { + this.name = name; + } + + @Nonnull public String getName() { + return this.name; + } + } + + public static class Sound { + + private final String sound; + + public Sound(@Nonnull final String sound) { + this.sound = sound; + } + + @Nonnull public String getSound() { + return this.sound; + } + } +} +``` + +Example Service: +```java +public interface MockPartialResultService extends + PartialResultService { +} +``` + +Example Implementations: +```java +public class DefaultPartialRequestService implements MockPartialResultService { + + @Nonnull @Override + public Map handleRequests( + @Nonnull final List requests) { + final Map map = new HashMap<>(requests.size()); + for (final MockChunkedRequest.Animal animal : requests) { + map.put(animal, new MockChunkedRequest.Sound("unknown")); + } + return map; + } + +} + +public class CompletingPartialResultService implements MockPartialResultService { + + @Nonnull @Override public Map handleRequests( + @Nonnull List requests) { + final Map map = new HashMap<>(); + for (final MockChunkedRequest.Animal animal : requests) { + if (animal.getName().equals("cow")) { + map.put(animal, new MockChunkedRequest.Sound("moo")); + } else if (animal.getName().equals("dog")) { + map.put(animal, new MockChunkedRequest.Sound("woof")); + } + } + return map; + } + +} +``` + +### Exception Handling + +Exceptions thrown during result retrieval and implementation filtering will be wrapped by +`PipelineException`. You can use `PipelineException#getCause` to get the exception that was wrapped. + +**Example:** + +```java +try { + final Result result = pipeline.pump(yourContext).through(YourService.class).getResult(); +} catch (final PipelineException exception) { + final Exception cause = exception.getCause(); +} +``` + +You may also make use of `ServicePipeline#getException(BiConsumer)`. This method +will unwrap any pipeline exceptions before passing them to the consumer. + +**Example:** + +```java +pipeline.getResult((result, exception) -> { + if (exception != null) { + exception.printStackTrace(); + } else { + // consume result + } +}); +``` diff --git a/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodService.java b/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodService.java new file mode 100644 index 00000000..07a6c558 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodService.java @@ -0,0 +1,98 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import com.google.common.base.Objects; +import cloud.commandframework.services.annotations.Order; +import cloud.commandframework.services.types.Service; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Method; + +class AnnotatedMethodService implements Service { + + private final ExecutionOrder executionOrder; + private final MethodHandle methodHandle; + private final Method method; + private final Object instance; + + AnnotatedMethodService(@Nonnull final Object instance, @Nonnull final Method method) + throws Exception { + ExecutionOrder executionOrder = ExecutionOrder.SOON; + try { + final Order order = method.getAnnotation(Order.class); + if (order != null) { + executionOrder = order.value(); + } + } catch (final Exception ignored) { + } + this.instance = instance; + this.executionOrder = executionOrder; + method.setAccessible(true); + this.methodHandle = MethodHandles.lookup().unreflect(method); + this.method = method; + } + + @Nullable + @Override + @SuppressWarnings("unchecked") + public Result handle(@Nonnull final Context context) { + try { + return (Result) this.methodHandle.invoke(this.instance, context); + } catch (final Throwable throwable) { + new IllegalStateException(String + .format("Failed to call method service implementation '%s' in class '%s'", + method.getName(), instance.getClass().getCanonicalName()), throwable) + .printStackTrace(); + } + return null; + } + + @Nonnull + @Override + public ExecutionOrder order() { + return this.executionOrder; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AnnotatedMethodService that = (AnnotatedMethodService) o; + return Objects.equal(this.methodHandle, that.methodHandle); + } + + @Override + public int hashCode() { + return Objects.hashCode(this.methodHandle); + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodServiceFactory.java b/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodServiceFactory.java new file mode 100644 index 00000000..addf0ecb --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/AnnotatedMethodServiceFactory.java @@ -0,0 +1,61 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import com.google.common.reflect.TypeToken; +import cloud.commandframework.services.annotations.ServiceImplementation; +import cloud.commandframework.services.types.Service; + +import javax.annotation.Nonnull; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +enum AnnotatedMethodServiceFactory { + INSTANCE; + + Map, TypeToken>> lookupServices( + @Nonnull final Object instance) throws Exception { + final Map, TypeToken>> map = new HashMap<>(); + final Class clazz = instance.getClass(); + for (final Method method : clazz.getDeclaredMethods()) { + final ServiceImplementation serviceImplementation = + method.getAnnotation(ServiceImplementation.class); + if (serviceImplementation == null) { + continue; + } + if (method.getParameterCount() != 1) { + throw new IllegalArgumentException(String.format( + "Method '%s' in class '%s'" + " has wrong parameter count. Expected 1, got %d", + method.getName(), instance.getClass().getCanonicalName(), + method.getParameterCount())); + + } + map.put(new AnnotatedMethodService<>(instance, method), + TypeToken.of(serviceImplementation.value())); + } + return map; + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/ExecutionOrder.java b/cloud-services/src/main/java/cloud/commandframework/services/ExecutionOrder.java new file mode 100644 index 00000000..f6f7561a --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/ExecutionOrder.java @@ -0,0 +1,32 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +/** + * Used to specify the relative priority of a service implementation + */ +@SuppressWarnings("unused") +public enum ExecutionOrder { + LAST, LATER, LATE, SOON, SOONER, FIRST +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/PipelineException.java b/cloud-services/src/main/java/cloud/commandframework/services/PipelineException.java new file mode 100644 index 00000000..7c1167c4 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/PipelineException.java @@ -0,0 +1,54 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import javax.annotation.Nonnull; + +/** + * Wrapper for exceptions thrown during pipeline execution. + * + * @see #getCause() Use {@link #getCause()} to get the wrapped exception + */ +public final class PipelineException extends RuntimeException { + + /** + * Construct a new pipeline exception + * + * @param cause Cause of the exception + */ + public PipelineException(@Nonnull final Exception cause) { + super(cause); + } + + /** + * Construct a new pipeline exception + * + * @param message Message explaining the exception + * @param cause Cause of the exception + */ + public PipelineException(@Nonnull final String message, @Nonnull final Exception cause) { + super(message, cause); + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/ServiceFilterHandler.java b/cloud-services/src/main/java/cloud/commandframework/services/ServiceFilterHandler.java new file mode 100644 index 00000000..8628f23b --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/ServiceFilterHandler.java @@ -0,0 +1,53 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import cloud.commandframework.services.types.Service; + +import javax.annotation.Nonnull; +import java.util.function.Predicate; + +enum ServiceFilterHandler { + INSTANCE; + + boolean passes( + @Nonnull final ServiceRepository.ServiceWrapper> service, + @Nonnull final Context context) { + if (!service.isDefaultImplementation()) { + for (final Predicate predicate : service.getFilters()) { + try { + if (!predicate.test(context)) { + return false; + } + } catch (final Exception e) { + throw new PipelineException(String + .format("Failed to evaluate filter '%s' for '%s'", + predicate.getClass().getCanonicalName(), service.toString()), e); + } + } + } + return true; + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/ServiceRepository.java b/cloud-services/src/main/java/cloud/commandframework/services/ServiceRepository.java new file mode 100644 index 00000000..cc230b13 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/ServiceRepository.java @@ -0,0 +1,153 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import com.google.common.reflect.TypeToken; +import cloud.commandframework.services.annotations.Order; +import cloud.commandframework.services.types.Service; + +import javax.annotation.Nonnull; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Predicate; + +/** + * Repository that contains implementations for a given service type + * + * @param Service context + * @param Service response type + */ +public final class ServiceRepository { + + private final Object lock = new Object(); + private final TypeToken> serviceType; + private final List>> implementations; + + private int registrationOrder = 0; + + /** + * Create a new service repository for a given service type + * + * @param serviceType Service type + */ + ServiceRepository(@Nonnull final TypeToken> serviceType) { + this.serviceType = serviceType; + this.implementations = new LinkedList<>(); + } + + /** + * Register a new implementation for the service + * + * @param service Implementation + * @param filters Filters that will be used to determine whether or not the service gets used + * @param Type of the implementation + */ + > void registerImplementation(@Nonnull final T service, + @Nonnull final Collection> filters) { + synchronized (this.lock) { + this.implementations.add(new ServiceWrapper<>(service, filters)); + } + } + + /** + * Get a queue containing all implementations + * + * @return Queue containing all implementations + */ + @Nonnull + LinkedList>> getQueue() { + synchronized (this.lock) { + return new LinkedList<>(this.implementations); + } + } + + + /** + * Used to store {@link Service} implementations together with their state + * + * @param Service type + */ + final class ServiceWrapper> + implements Comparable> { + + private final boolean defaultImplementation; + private final T implementation; + private final Collection> filters; + + private final int registrationOrder = ServiceRepository.this.registrationOrder++; + private final ExecutionOrder executionOrder; + + private ServiceWrapper(@Nonnull final T implementation, + @Nonnull final Collection> filters) { + this.defaultImplementation = implementations.isEmpty(); + this.implementation = implementation; + this.filters = filters; + ExecutionOrder executionOrder = implementation.order(); + if (executionOrder == null) { + final Order order = implementation.getClass().getAnnotation(Order.class); + if (order != null) { + executionOrder = order.value(); + } else { + executionOrder = ExecutionOrder.SOON; + } + } + this.executionOrder = executionOrder; + } + + @Nonnull + T getImplementation() { + return this.implementation; + } + + @Nonnull + Collection> getFilters() { + return Collections.unmodifiableCollection(this.filters); + } + + boolean isDefaultImplementation() { + return this.defaultImplementation; + } + + @Override + public String toString() { + return String + .format("ServiceWrapper{type=%s,implementation=%s}", serviceType.toString(), + TypeToken.of(implementation.getClass()).toString()); + } + + @Override + public int compareTo(@Nonnull final ServiceWrapper other) { + return Comparator.>comparingInt( + wrapper -> wrapper.isDefaultImplementation() + ? Integer.MIN_VALUE + : Integer.MAX_VALUE).thenComparingInt(wrapper -> wrapper.executionOrder.ordinal()) + .thenComparingInt(wrapper -> wrapper.registrationOrder).compare(this, other); + } + + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/ServiceSpigot.java b/cloud-services/src/main/java/cloud/commandframework/services/ServiceSpigot.java new file mode 100644 index 00000000..80e8bdee --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/ServiceSpigot.java @@ -0,0 +1,173 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import com.google.common.reflect.TypeToken; +import cloud.commandframework.services.types.ConsumerService; +import cloud.commandframework.services.types.Service; +import cloud.commandframework.services.types.SideEffectService; + +import javax.annotation.Nonnull; +import java.util.LinkedList; +import java.util.concurrent.CompletableFuture; +import java.util.function.BiConsumer; + +/** + * Class that outputs results from the given context, using the specified service type + * + * @param Context type + * @param Result type + */ +public final class ServiceSpigot { + + private final Context context; + private final ServicePipeline pipeline; + private final ServiceRepository repository; + + ServiceSpigot(@Nonnull final ServicePipeline pipeline, @Nonnull final Context context, + @Nonnull final TypeToken> type) { + this.context = context; + this.pipeline = pipeline; + this.repository = pipeline.getRepository(type); + } + + /** + * Get the first result that is generated for the given context. This cannot return {@code null}. + * If nothing manages to produce a result, an exception will be thrown. If the pipeline has been + * constructed properly, this will never happen. + * + * @return Generated result + * @throws IllegalStateException If no result was found. This only happens if the pipeline has not + * been constructed properly. The most likely cause is a faulty + * default implementation + * @throws IllegalStateException If a {@link SideEffectService} returns {@code null} + * @throws PipelineException Any exceptions thrown during result retrieval from the + * implementations will be wrapped by {@link PipelineException}. Use + * {@link PipelineException#getCause()} to get the exception that + * was thrown. + * @throws PipelineException Any exceptions thrown during filtering will be wrapped by {@link + * PipelineException}. Use {@link PipelineException#getCause()} to + * get the exception that was thrown. + * @see PipelineException PipelineException wraps exceptions thrown during filtering and result + * retrieval + */ + @Nonnull + @SuppressWarnings("unchecked") + public Result getResult() + throws IllegalStateException, PipelineException { + final LinkedList.ServiceWrapper>> + queue = this.repository.getQueue(); + queue.sort(null); // Sort using the built in comparator method + ServiceRepository.ServiceWrapper> + wrapper; + boolean consumerService = false; + while ((wrapper = queue.pollLast()) != null) { + consumerService = wrapper.getImplementation() instanceof ConsumerService; + if (!ServiceFilterHandler.INSTANCE.passes(wrapper, this.context)) { + continue; + } + final Result result; + try { + result = wrapper.getImplementation().handle(this.context); + } catch (final Exception e) { + throw new PipelineException( + String.format("Failed to retrieve result from %s", wrapper.toString()), e); + } + if (wrapper.getImplementation() instanceof SideEffectService) { + if (result == null) { + throw new IllegalStateException( + String.format("SideEffectService '%s' returned null", wrapper.toString())); + } else if (result == State.ACCEPTED) { + return result; + } + } else if (result != null) { + return result; + } + } + // This is hack to make it so that the default + // consumer implementation does not have to call #interrupt + if (consumerService) { + return (Result) State.ACCEPTED; + } + throw new IllegalStateException( + "No service consumed the context. This means that the pipeline was not constructed properly."); + } + + /** + * Get the first result that is generated for the given context. If nothing manages to produce a + * result, an exception will be thrown. If the pipeline has been constructed properly, this will + * never happen. The exception passed to the consumer will be unwrapped, in the case that it's a + * {@link PipelineException}. Thus, the actual exception will be given instead of the wrapper. + * + * @param consumer Result consumer. If an exception was wrong, the result will be {@code null}, + * otherwise the exception will be non-null and the exception will be {@code + * null}. + * @throws IllegalStateException If no result was found. This only happens if the pipeline has not + * been constructed properly. The most likely cause is a faulty + * default implementation + * @throws IllegalStateException If a {@link SideEffectService} returns {@code null} + */ + public void getResult(@Nonnull final BiConsumer consumer) { + try { + consumer.accept(getResult(), null); + } catch (final PipelineException pipelineException) { + consumer.accept(null, pipelineException.getCause()); + } catch (final Exception e) { + consumer.accept(null, e); + } + } + + /** + * Get the first result that is generated for the given context. This cannot return null. If + * nothing manages to produce a result, an exception will be thrown. If the pipeline has been + * constructed properly, this will never happen. + * + * @return Generated result + */ + @Nonnull + public CompletableFuture getResultAsynchronously() { + return CompletableFuture.supplyAsync(this::getResult, this.pipeline.getExecutor()); + } + + /** + * Forward the request through the original pipeline. + * + * @return New pump, for the result of this request + */ + @Nonnull + public ServicePump forward() { + return this.pipeline.pump(this.getResult()); + } + + /** + * Forward the request through the original pipeline. + * + * @return New pump, for the result of this request + */ + @Nonnull + public CompletableFuture> forwardAsynchronously() { + return this.getResultAsynchronously().thenApply(pipeline::pump); + } + +} diff --git a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/package-info.java b/cloud-services/src/main/java/cloud/commandframework/services/State.java similarity index 71% rename from cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/package-info.java rename to cloud-services/src/main/java/cloud/commandframework/services/State.java index 8b77ee77..4304b35b 100644 --- a/cloud-core/src/main/java/com/intellectualsites/commands/annotations/specifier/package-info.java +++ b/cloud-services/src/main/java/cloud/commandframework/services/State.java @@ -1,7 +1,7 @@ // // MIT License // -// Copyright (c) 2020 Alexander Söderberg +// Copyright (c) 2020 IntellectualSites // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -21,9 +21,18 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // +package cloud.commandframework.services; /** - * Standard annotations used to match {@link com.intellectualsites.commands.arguments.parser.ArgumentParser} - * in {@link com.intellectualsites.commands.arguments.parser.ParserRegistry} + * This indicates how a {@link cloud.commandframework.services.types.Service} responded to a given context */ -package com.intellectualsites.commands.annotations.specifier; +public enum State { + /** + * The service consumed the context successfully and the execution should stop + */ + ACCEPTED, + /** + * The service did not consume the context and the execution should continue + */ + REJECTED +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/annotations/ServiceImplementation.java b/cloud-services/src/main/java/cloud/commandframework/services/annotations/ServiceImplementation.java new file mode 100644 index 00000000..0fcad32d --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/annotations/ServiceImplementation.java @@ -0,0 +1,54 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.annotations; + +import cloud.commandframework.services.types.Service; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used to bind methods to services, like such: + * + *

{@code
+ * {@literal @}Nullable
+ * {@literal @}ServiceImplementation(YourService.class)
+ * public YourResult handle(YourContext) {
+ *      return result;
+ * }
+ * }
+ */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface ServiceImplementation { + + /** + * The service class that the method implements + * + * @return Service to implement + */ + Class> value(); +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/package-info.java b/cloud-services/src/main/java/cloud/commandframework/services/package-info.java new file mode 100644 index 00000000..c7da1bc0 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/package-info.java @@ -0,0 +1,28 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +/** + * IntellectualSites service pipeline system + */ +package cloud.commandframework.services; diff --git a/cloud-services/src/main/java/cloud/commandframework/services/types/ConsumerService.java b/cloud-services/src/main/java/cloud/commandframework/services/types/ConsumerService.java new file mode 100644 index 00000000..19471dd5 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/types/ConsumerService.java @@ -0,0 +1,90 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.types; + +import cloud.commandframework.services.State; + +import javax.annotation.Nonnull; +import java.util.function.Consumer; + +/** + * Service type where each implementation gets a chance to consume the context. This service type + * effectively turns the pipeline into an event bus. + *

+ * A service can forcefully terminate execution by calling {@link #interrupt()} + * + * @param Context + */ +@FunctionalInterface +public interface ConsumerService + extends SideEffectService, Consumer { + + /** + * Immediately terminate the execution and return {@link State#ACCEPTED} + * + * @throws PipeBurst Pipe burst + */ + static void interrupt() throws PipeBurst { + throw new PipeBurst(); + } + + @Nonnull + @Override + default State handle(@Nonnull final Context context) { + try { + this.accept(context); + } catch (final PipeBurst burst) { + return State.ACCEPTED; + } + return State.REJECTED; + } + + /** + * Accept the context. Call {@link #interrupt()} to interrupt the entire pipeline and immediately + * return {@link State#ACCEPTED} to the sink + * + * @param context Context to consume + */ + @Override + void accept(@Nonnull Context context); + + + class PipeBurst extends RuntimeException { + + private PipeBurst() { + } + + @Override + public synchronized Throwable fillInStackTrace() { + return this; + } + + @Override + public synchronized Throwable initCause(final Throwable cause) { + return this; + } + + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/types/PartialResultService.java b/cloud-services/src/main/java/cloud/commandframework/services/types/PartialResultService.java new file mode 100644 index 00000000..dd8b6c12 --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/types/PartialResultService.java @@ -0,0 +1,65 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.types; + +import cloud.commandframework.services.ChunkedRequestContext; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; +import java.util.Map; + +/** + * Service type that allows service to generate partial results for bigger requests + * + * @param Context type + * @param Result type + * @param Chunk request context + */ +public interface PartialResultService> + extends Service> { + + @Override + @Nullable + default Map handle(@Nonnull final Chunked context) { + if (!context.isCompleted()) { + this.handleRequests(context.getRemaining()).forEach(context::storeResult); + } + if (context.isCompleted()) { + return context.getAvailableResults(); + } + return null; + } + + /** + * Attempt to generate results for a list of requests, and return a map of all successful + * requests + * + * @param requests Requests + * @return Map of request-result pairs + */ + @Nonnull + Map handleRequests(@Nonnull List requests); + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/types/Service.java b/cloud-services/src/main/java/cloud/commandframework/services/types/Service.java new file mode 100644 index 00000000..4b6b32ea --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/types/Service.java @@ -0,0 +1,78 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.types; + +import cloud.commandframework.services.ExecutionOrder; +import cloud.commandframework.services.PipelineException; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.function.Function; + +/** + * A service is anything that can take in a context, and produce a response. Most service + * implementations will be side effect free, although some service implementations will have side + * effects. Those that do, should be clearly labeled + * + * @param Context type, this will be the input that is used to generate the response + * @param Response type, this is what is produced by the service ("provided") + */ +@FunctionalInterface +public interface Service extends Function { + + /** + * Provide a response for the given context. If the service implementation cannot provide a + * response for the given context, it should return {@code null} + * + * @param context Context used in the generation of the response + * @return Response. If the response isn't {@code null}, the next service in the service chain + * will get to act on the context. Otherwise the execution halts, and the provided response is the + * final response. + * @throws Exception Any exception that occurs during the handling can be thrown, and will be + * wrapped by a {@link PipelineException} + */ + @Nullable + Result handle(@Nonnull Context context) throws Exception; + + @Override + default Result apply(@Nonnull Context context) { + try { + return this.handle(context); + } catch (final Exception exception) { + throw new PipelineException(exception); + } + } + + /** + * Get the execution order of the service. This should not be overridden, unless you know what you + * are doing + * + * @return Execution order + */ + @Nullable + default ExecutionOrder order() { + return null; + } + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/types/SideEffectService.java b/cloud-services/src/main/java/cloud/commandframework/services/types/SideEffectService.java new file mode 100644 index 00000000..1a007c6a --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/types/SideEffectService.java @@ -0,0 +1,55 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.types; + +import cloud.commandframework.services.State; + +import javax.annotation.Nonnull; + +/** + * Service implementation that alters the state of the owning application in some way. A + * SideEffectService does not return a generated result, instead it returns a response, indicating + * whether or not the context was consumed + * + * @param Context type. + */ +@FunctionalInterface +public interface SideEffectService extends Service { + + /** + * Consumes the context, if possible. Returns {@link State#ACCEPTED} if the input was consumed, + * else {@link State#REJECTED} + * + * @param context context used in the generation of the response + * @return Response. If the response isn't {@link State#ACCEPTED}, the next service in the service + * chain will get to act on the context. Otherwise the execution halts, and the provided response + * is the final response. + * @throws Exception Any exception that occurs during the handling can be thrown, and will be + * wrapped by a {@link cloud.commandframework.services.PipelineException} + */ + @Override + @Nonnull + State handle(@Nonnull Context context) throws Exception; + +} diff --git a/cloud-services/src/main/java/cloud/commandframework/services/types/package-info.java b/cloud-services/src/main/java/cloud/commandframework/services/types/package-info.java new file mode 100644 index 00000000..7867813c --- /dev/null +++ b/cloud-services/src/main/java/cloud/commandframework/services/types/package-info.java @@ -0,0 +1,28 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + +/** + * Service implementation types + */ +package cloud.commandframework.services.types; diff --git a/cloud-services/src/test/java/cloud/commandframework/services/ServicesTest.java b/cloud-services/src/test/java/cloud/commandframework/services/ServicesTest.java new file mode 100644 index 00000000..ade0935d --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/ServicesTest.java @@ -0,0 +1,209 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services; + +import com.google.common.reflect.TypeToken; +import cloud.commandframework.services.mock.*; +import cloud.commandframework.services.types.Service; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.util.*; + +public class ServicesTest { + + @Test + public void testPipeline() throws Exception { + final ServicePipeline servicePipeline = ServicePipeline.builder().build(); + Assertions.assertNotNull(servicePipeline); + servicePipeline + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); + Assertions.assertThrows(IllegalArgumentException.class, () -> servicePipeline + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService())); + final SecondaryMockService secondaryMockService = new SecondaryMockService(); + servicePipeline + .registerServiceImplementation(TypeToken.of(MockService.class), secondaryMockService, + Collections.singleton(secondaryMockService)); + servicePipeline.registerServiceImplementation(MockService.class, + mockContext -> new MockService.MockResult(-91), + Collections.singleton(mockContext -> mockContext.getString().startsWith("-91"))); + Assertions.assertEquals(32, + servicePipeline.pump(new MockService.MockContext("Hello")).through(MockService.class) + .getResult().getInteger()); + servicePipeline.pump(new MockService.MockContext("Hello")).through(MockService.class) + .getResult( + (mockResult, throwable) -> Assertions.assertEquals(32, mockResult.getInteger())); + Assertions.assertEquals(999, + servicePipeline.pump(new MockService.MockContext("potato")).through(MockService.class) + .getResult().getInteger()); + Assertions.assertEquals(-91, + servicePipeline.pump(new MockService.MockContext("-91")).through(MockService.class) + .getResult().getInteger()); + Assertions.assertNotNull( + servicePipeline.pump(new MockService.MockContext("oi")).through(MockService.class) + .getResultAsynchronously().get()); + + } + + @Test + public void testSideEffectServices() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build(); + servicePipeline.registerServiceType(TypeToken.of(MockSideEffectService.class), + new DefaultSideEffectService()); + final MockSideEffectService.MockPlayer mockPlayer = + new MockSideEffectService.MockPlayer(20); + Assertions.assertEquals(20, mockPlayer.getHealth()); + Assertions.assertEquals(State.ACCEPTED, + servicePipeline.pump(mockPlayer).through(MockSideEffectService.class).getResult()); + Assertions.assertEquals(0, mockPlayer.getHealth()); + mockPlayer.setHealth(20); + servicePipeline.registerServiceImplementation(MockSideEffectService.class, + new SecondaryMockSideEffectService(), Collections.emptyList()); + Assertions.assertThrows(IllegalStateException.class, + () -> servicePipeline.pump(mockPlayer).through(MockSideEffectService.class) + .getResult()); + } + + @Test + public void testForwarding() throws Exception { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()) + .registerServiceType(TypeToken.of(MockResultConsumer.class), new MockResultConsumer()); + Assertions.assertEquals(State.ACCEPTED, + servicePipeline.pump(new MockService.MockContext("huh")).through(MockService.class) + .forward().through(MockResultConsumer.class).getResult()); + Assertions.assertEquals(State.ACCEPTED, + servicePipeline.pump(new MockService.MockContext("Something")) + .through(MockService.class).forwardAsynchronously() + .thenApply(pump -> pump.through(MockResultConsumer.class)) + .thenApply(ServiceSpigot::getResult).get()); + } + + @Test + public void testSorting() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); + servicePipeline.registerServiceImplementation(MockService.class, new MockOrderedFirst(), + Collections.emptyList()); + servicePipeline.registerServiceImplementation(MockService.class, new MockOrderedLast(), + Collections.emptyList()); + // Test that the annotations worked + Assertions.assertEquals(1, + servicePipeline.pump(new MockService.MockContext("")).through(MockService.class) + .getResult().getInteger()); + } + + @Test + public void testRecognisedTypes() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); + Assertions.assertEquals(1, servicePipeline.getRecognizedTypes().size()); + } + + @Test + public void testImplementationGetters() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); + servicePipeline.registerServiceImplementation(MockService.class, new MockOrderedFirst(), + Collections.emptyList()); + servicePipeline.registerServiceImplementation(MockService.class, new MockOrderedLast(), + Collections.emptyList()); + final TypeToken> first = TypeToken.of(MockOrderedFirst.class), + last = TypeToken.of(MockOrderedLast.class); + final TypeToken mockServiceType = TypeToken.of(MockService.class); + for (TypeToken typeToken : servicePipeline.getRecognizedTypes()) { + Assertions.assertEquals(mockServiceType, typeToken); + } + final Collection>> + impls = servicePipeline.getImplementations(mockServiceType); + Assertions.assertEquals(3, impls.size()); + final Iterator>> + iterator = impls.iterator(); + Assertions.assertEquals(first, iterator.next()); + Assertions.assertEquals(last, iterator.next()); + Assertions.assertEquals(DefaultMockService.class, iterator.next().getRawType()); + } + + @Test + public void testAnnotatedMethods() throws Exception { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()) + .registerMethods(new AnnotatedMethodTest()); + final String testString = UUID.randomUUID().toString(); + Assertions.assertEquals(testString.length(), + servicePipeline.pump(new MockService.MockContext(testString)).through(MockService.class) + .getResult().getInteger()); + } + + @Test + public void testConsumerServices() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockConsumerService.class), + new StateSettingConsumerService()) + .registerServiceImplementation(MockConsumerService.class, + new InterruptingMockConsumer(), Collections.emptyList()); + final MockService.MockContext context = new MockService.MockContext(""); + servicePipeline.pump(context).through(MockConsumerService.class).getResult(); + Assertions.assertEquals("", context.getState()); + } + + @Test + public void testPartialResultServices() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build() + .registerServiceType(TypeToken.of(MockPartialResultService.class), + new DefaultPartialRequestService()) + .registerServiceImplementation(MockPartialResultService.class, + new CompletingPartialResultService(), Collections.emptyList()); + final MockChunkedRequest.Animal cow = new MockChunkedRequest.Animal("cow"); + final MockChunkedRequest.Animal dog = new MockChunkedRequest.Animal("dog"); + final MockChunkedRequest.Animal cat = new MockChunkedRequest.Animal("cat"); + final Map sounds = + servicePipeline.pump(new MockChunkedRequest(Arrays.asList(cow, dog, cat))) + .through(MockPartialResultService.class).getResult(); + Assertions.assertEquals("moo", sounds.get(cow).getSound()); + Assertions.assertEquals("woof", sounds.get(dog).getSound()); + Assertions.assertEquals("unknown", sounds.get(cat).getSound()); + } + + @Test + public void testExceptions() { + final ServicePipeline servicePipeline = ServicePipeline.builder().build(); + Assertions.assertNotNull(servicePipeline); + servicePipeline + .registerServiceType(TypeToken.of(MockService.class), new DefaultMockService()); + final PipelineException pipelineException = Assertions.assertThrows(PipelineException.class, + () -> servicePipeline.pump(new MockService.MockContext("pls throw exception")) + .through(MockService.class).getResult()); + Assertions.assertEquals(DefaultMockService.TotallyIntentionalException.class, + pipelineException.getCause().getClass()); + servicePipeline.pump(new MockService.MockContext("pls throw exception")) + .through(MockService.class).getResult((result, throwable) -> { + Assertions.assertNotNull(throwable); + Assertions.assertEquals(DefaultMockService.TotallyIntentionalException.class, + throwable.getClass()); + Assertions.assertNull(result); + }); + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultMockService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultMockService.java new file mode 100644 index 00000000..3a8fe7ec --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultMockService.java @@ -0,0 +1,47 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +public class DefaultMockService implements MockService { + + @Nullable + @Override + public MockResult handle(@Nonnull final MockContext mockContext) + throws Exception { + if (mockContext.getString().equals("pls throw exception")) { + throw new TotallyIntentionalException(); + } + return new MockResult(32); + } + + + public static class TotallyIntentionalException extends Exception { + + } + +} + diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultPartialRequestService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultPartialRequestService.java new file mode 100644 index 00000000..c822145a --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/DefaultPartialRequestService.java @@ -0,0 +1,45 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import javax.annotation.Nonnull; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultPartialRequestService implements MockPartialResultService { + + @Nonnull + @Override + public Map handleRequests( + @Nonnull final List requests) { + final Map map = + new HashMap<>(requests.size()); + for (final MockChunkedRequest.Animal animal : requests) { + map.put(animal, new MockChunkedRequest.Sound("unknown")); + } + return map; + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/InterruptingMockConsumer.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/InterruptingMockConsumer.java new file mode 100644 index 00000000..ec44d661 --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/InterruptingMockConsumer.java @@ -0,0 +1,37 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.types.ConsumerService; + +import javax.annotation.Nonnull; + +public class InterruptingMockConsumer implements MockConsumerService { + + @Override + public void accept(@Nonnull final MockService.MockContext mockContext) { + ConsumerService.interrupt(); + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/MockConsumerService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockConsumerService.java new file mode 100644 index 00000000..18ec1fb3 --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockConsumerService.java @@ -0,0 +1,30 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.types.ConsumerService; + +public interface MockConsumerService extends ConsumerService { + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedFirst.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedFirst.java new file mode 100644 index 00000000..a671a82c --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedFirst.java @@ -0,0 +1,41 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.ExecutionOrder; +import cloud.commandframework.services.annotations.Order; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@Order(ExecutionOrder.FIRST) +public class MockOrderedFirst implements MockService { + + @Nullable + @Override + public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(1); + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedLast.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedLast.java new file mode 100644 index 00000000..33bb7edb --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockOrderedLast.java @@ -0,0 +1,41 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.ExecutionOrder; +import cloud.commandframework.services.annotations.Order; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@Order(ExecutionOrder.LAST) +public class MockOrderedLast implements MockService { + + @Nullable + @Override + public MockResult handle(@Nonnull final MockContext mockContext) { + return new MockResult(2); + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/MockPartialResultService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockPartialResultService.java new file mode 100644 index 00000000..225b52d0 --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/MockPartialResultService.java @@ -0,0 +1,31 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.types.PartialResultService; + +public interface MockPartialResultService extends + PartialResultService { + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/SecondaryMockSideEffectService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/SecondaryMockSideEffectService.java new file mode 100644 index 00000000..d4331ec1 --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/SecondaryMockSideEffectService.java @@ -0,0 +1,38 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import cloud.commandframework.services.State; + +import javax.annotation.Nonnull; + +public class SecondaryMockSideEffectService implements MockSideEffectService { + + @Nonnull + @Override + public State handle(@Nonnull final MockPlayer mockPlayer) { + return null; + } + +} diff --git a/cloud-services/src/test/java/cloud/commandframework/services/mock/StateSettingConsumerService.java b/cloud-services/src/test/java/cloud/commandframework/services/mock/StateSettingConsumerService.java new file mode 100644 index 00000000..3007b2f6 --- /dev/null +++ b/cloud-services/src/test/java/cloud/commandframework/services/mock/StateSettingConsumerService.java @@ -0,0 +1,35 @@ +// +// MIT License +// +// Copyright (c) 2020 IntellectualSites +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +package cloud.commandframework.services.mock; + +import javax.annotation.Nonnull; + +public class StateSettingConsumerService implements MockConsumerService { + + @Override + public void accept(@Nonnull final MockService.MockContext mockContext) { + mockContext.setState(""); + } + +} diff --git a/pom.xml b/pom.xml index 525d80a4..ff65d1a2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.intellectualsites + cloud.commandframework cloud 1.0-SNAPSHOT cloud-jline cloud-core - cloud-pipeline + cloud-services cloud-annotations cloud-minecraft/cloud-bukkit-test