Restructure project and fix JavaDoc generation

This commit is contained in:
Alexander Söderberg 2020-09-11 09:15:12 +02:00
parent 268ff80226
commit 514aa6c725
12 changed files with 21 additions and 12 deletions

View file

@ -31,11 +31,7 @@ import com.intellectualsites.commands.sender.CommandSender;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Collections; import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@ -100,6 +96,9 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
* Create a new command builder * Create a new command builder
* *
* @param commandName Base command component * @param commandName Base command component
* @param commandMeta Command meta instance
* @param <C> Command sender type
* @param <M> Command meta type
* @return Command builder * @return Command builder
*/ */
@Nonnull @Nonnull
@ -163,6 +162,7 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
* Get the longest chain of similar components for * Get the longest chain of similar components for
* two commands * two commands
* *
* @param other Command to compare to
* @return List containing the longest shared component chain * @return List containing the longest shared component chain
*/ */
public List<CommandComponent<C, ?>> getSharedComponentChain(@Nonnull final Command<C, M> other) { public List<CommandComponent<C, ?>> getSharedComponentChain(@Nonnull final Command<C, M> other) {
@ -216,7 +216,8 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
public <T> Builder<C, M> withComponent(@Nonnull final CommandComponent<C, T> component) { public <T> Builder<C, M> withComponent(@Nonnull final CommandComponent<C, T> component) {
final List<CommandComponent<C, ?>> commandComponents = new LinkedList<>(this.commandComponents); final List<CommandComponent<C, ?>> commandComponents = new LinkedList<>(this.commandComponents);
commandComponents.add(component); commandComponents.add(component);
return new Builder<>(this.commandMeta, this.senderType, commandComponents, this.commandExecutionHandler, this.commandPermission); return new Builder<>(this.commandMeta, this.senderType, commandComponents, this.commandExecutionHandler,
this.commandPermission);
} }
/** /**
@ -245,7 +246,8 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
*/ */
@Nonnull @Nonnull
public Builder<C, M> withHandler(@Nonnull final CommandExecutionHandler<C> commandExecutionHandler) { public Builder<C, M> withHandler(@Nonnull final CommandExecutionHandler<C> commandExecutionHandler) {
return new Builder<>(this.commandMeta, this.senderType, this.commandComponents, commandExecutionHandler, this.commandPermission); return new Builder<>(this.commandMeta, this.senderType, this.commandComponents, commandExecutionHandler,
this.commandPermission);
} }
/** /**
@ -256,7 +258,8 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
*/ */
@Nonnull @Nonnull
public Builder<C, M> withSenderType(@Nonnull final Class<? extends C> senderType) { public Builder<C, M> withSenderType(@Nonnull final Class<? extends C> senderType) {
return new Builder<>(this.commandMeta, senderType, this.commandComponents, this.commandExecutionHandler, this.commandPermission); return new Builder<>(this.commandMeta, senderType, this.commandComponents, this.commandExecutionHandler,
this.commandPermission);
} }
/** /**
@ -267,7 +270,8 @@ public class Command<C extends CommandSender, M extends CommandMeta> {
*/ */
@Nonnull @Nonnull
public Builder<C, M> withPermission(@Nonnull final String permission) { public Builder<C, M> withPermission(@Nonnull final String permission) {
return new Builder<>(this.commandMeta, this.senderType, this.commandComponents, this.commandExecutionHandler, permission); return new Builder<>(this.commandMeta, this.senderType, this.commandComponents, this.commandExecutionHandler,
permission);
} }
/** /**

View file

@ -31,6 +31,7 @@ public interface CommandSender {
* Check if the command sender has a given permission node * Check if the command sender has a given permission node
* *
* @param permission Permission node * @param permission Permission node
* @return {@code true} if the sender has the given permission node, else {@code false}
*/ */
boolean hasPermission(@Nonnull String permission); boolean hasPermission(@Nonnull String permission);

View file

@ -29,6 +29,7 @@
xmlns="http://maven.apache.org/POM/4.0.0" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<relativePath>../../</relativePath>
<artifactId>cloud</artifactId> <artifactId>cloud</artifactId>
<groupId>com.intellectualsites</groupId> <groupId>com.intellectualsites</groupId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>

View file

@ -9,7 +9,7 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<modules> <modules>
<module>cloud-jline</module> <module>cloud-jline</module>
<module>cloud-bukkit</module> <module>cloud-minecraft/cloud-bukkit</module>
<module>cloud-core</module> <module>cloud-core</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>
@ -95,6 +95,9 @@
</goals> </goals>
</execution> </execution>
</executions> </executions>
<configuration>
<source>1.8</source>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>