Cleaned up more documentation

This commit is contained in:
Nicholas Rees 2021-05-02 17:42:23 -05:00
parent 931ded5190
commit d2177c02a4
9 changed files with 37 additions and 0 deletions

@ -82,6 +82,7 @@ public class CacheRepository extends RedisRepository<String, ICacheItem<?>> {
/** /**
* Find a {@link ICacheItem} by the given {@link Class} and identifier * Find a {@link ICacheItem} by the given {@link Class} and identifier
*
* @param clazz the class of the cache item to lookup * @param clazz the class of the cache item to lookup
* @param identifier the identifier of the cache item * @param identifier the identifier of the cache item
* @return the optional cache item * @return the optional cache item
@ -92,6 +93,7 @@ public class CacheRepository extends RedisRepository<String, ICacheItem<?>> {
/** /**
* Find a {@link ICacheItem} by the given {@link Class} and test against the {@link Predicate} * Find a {@link ICacheItem} by the given {@link Class} and test against the {@link Predicate}
*
* @param clazz the class of the cache item to lookup * @param clazz the class of the cache item to lookup
* @param predicate the predicate to test against * @param predicate the predicate to test against
* @return the optional cache item * @return the optional cache item
@ -104,6 +106,7 @@ public class CacheRepository extends RedisRepository<String, ICacheItem<?>> {
/** /**
* Find a {@link ICacheItem} by the given {@link Class} and identifier and remove it from Redis * Find a {@link ICacheItem} by the given {@link Class} and identifier and remove it from Redis
*
* @param clazz the class of the cache item to remove * @param clazz the class of the cache item to remove
* @param identifier the identifier of the cache item * @param identifier the identifier of the cache item
*/ */

@ -60,6 +60,7 @@ public class JedisCommandHandler {
/** /**
* Add a command listener * Add a command listener
*
* @param consumer The listener to add * @param consumer The listener to add
*/ */
public void addListener(Consumer<JedisCommand> consumer) { public void addListener(Consumer<JedisCommand> consumer) {
@ -68,6 +69,7 @@ public class JedisCommandHandler {
/** /**
* Send a {@link JedisCommand} across the network * Send a {@link JedisCommand} across the network
*
* @param command The command to send * @param command The command to send
*/ */
public void send(JedisCommand command) { public void send(JedisCommand command) {

@ -23,6 +23,7 @@ public class Node {
/** /**
* Check whether or not the Node is reachable * Check whether or not the Node is reachable
*
* @return the reachable state * @return the reachable state
*/ */
@SneakyThrows @SneakyThrows
@ -53,6 +54,7 @@ public class Node {
/** /**
* Get a list of {@link MinecraftServer}'s running under this node * Get a list of {@link MinecraftServer}'s running under this node
*
* @return the list of servers * @return the list of servers
*/ */
public Collection<MinecraftServer> getServers() { public Collection<MinecraftServer> getServers() {

@ -27,6 +27,7 @@ public class ServerGroup {
/** /**
* Get a list of {@link MinecraftServer}'s running under this server group * Get a list of {@link MinecraftServer}'s running under this server group
*
* @return the list of servers * @return the list of servers
*/ */
public Collection<MinecraftServer> getServers() { public Collection<MinecraftServer> getServers() {

@ -41,6 +41,7 @@ public class MinecraftServer {
/** /**
* Set the state of the server to the given state * Set the state of the server to the given state
*
* @param state the state * @param state the state
*/ */
public void setState(ServerState state) { public void setState(ServerState state) {
@ -52,6 +53,7 @@ public class MinecraftServer {
/** /**
* Return whether or not the Minecraft server is running by checking * Return whether or not the Minecraft server is running by checking
* the dead state and the server state * the dead state and the server state
*
* @return the running state * @return the running state
*/ */
public boolean isRunning() { public boolean isRunning() {
@ -63,6 +65,7 @@ public class MinecraftServer {
/** /**
* Return whether or not the Minecraft server is lagging by * Return whether or not the Minecraft server is lagging by
* checking if ths tps is 15 or below * checking if ths tps is 15 or below
*
* @return the lagging state * @return the lagging state
*/ */
public boolean isLagging() { public boolean isLagging() {
@ -73,6 +76,7 @@ public class MinecraftServer {
* Return whether or not the Minecraft server is dead. * Return whether or not the Minecraft server is dead.
* A server is considered dead if it hasn't sent a heartbeat * A server is considered dead if it hasn't sent a heartbeat
* within 8 seconds and the server is older than 30 seconds * within 8 seconds and the server is older than 30 seconds
*
* @return the dead state * @return the dead state
*/ */
public boolean isDead() { public boolean isDead() {
@ -83,6 +87,7 @@ public class MinecraftServer {
/** /**
* Return whether or not the server was created in the last minute * Return whether or not the server was created in the last minute
*
* @return the new state * @return the new state
*/ */
public boolean isNew() { public boolean isNew() {
@ -91,6 +96,7 @@ public class MinecraftServer {
/** /**
* Get the uptime of the server in millis * Get the uptime of the server in millis
*
* @return the uptime * @return the uptime
*/ */
public long getUptime() { public long getUptime() {

@ -33,6 +33,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Lookup a {@link T} object by {@link I} * Lookup a {@link T} object by {@link I}
*
* @param i The object to use to do the lookup * @param i The object to use to do the lookup
* @return optional {@link T} * @return optional {@link T}
*/ */
@ -40,6 +41,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Get the Redis key for the given {@link T} object * Get the Redis key for the given {@link T} object
*
* @param t The object to get the key for * @param t The object to get the key for
* @return the key * @return the key
*/ */
@ -47,6 +49,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Create a new {@link T} instance from the given map * Create a new {@link T} instance from the given map
*
* @param map The map * @param map The map
* @return the new instance * @return the new instance
*/ */
@ -54,12 +57,14 @@ public abstract class RedisRepository<I, T> {
/** /**
* Get how long a key should be stored * Get how long a key should be stored
*
* @return the expiration time, -1 if none * @return the expiration time, -1 if none
*/ */
public abstract long getExpiration(T t); public abstract long getExpiration(T t);
/** /**
* Create a new map for the given {@link T} object * Create a new map for the given {@link T} object
*
* @param t The object` * @param t The object`
* @return the map * @return the map
*/ */
@ -67,6 +72,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Get the cached value for the repository * Get the cached value for the repository
*
* @return the cached values * @return the cached values
*/ */
public List<T> getCached() { public List<T> getCached() {
@ -75,6 +81,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Lookup a {@link T} object that tests against the {@link Predicate} * Lookup a {@link T} object that tests against the {@link Predicate}
*
* @param predicate The predicate to test * @param predicate The predicate to test
* @return optional {@link T} * @return optional {@link T}
*/ */
@ -84,6 +91,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Add an update listener * Add an update listener
*
* @param consumer the consumer to add * @param consumer the consumer to add
*/ */
public void addUpdateListener(Consumer<List<T>> consumer) { public void addUpdateListener(Consumer<List<T>> consumer) {
@ -92,6 +100,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Adds the given {@link T} object to the local cache and to Redis * Adds the given {@link T} object to the local cache and to Redis
*
* @param t The object to add * @param t The object to add
*/ */
public void post(T t) { public void post(T t) {
@ -114,6 +123,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Remove the given {@link T} object from the local cache and from Redis * Remove the given {@link T} object from the local cache and from Redis
*
* @param t The object to remove * @param t The object to remove
*/ */
public void remove(T t) { public void remove(T t) {
@ -156,6 +166,7 @@ public abstract class RedisRepository<I, T> {
/** /**
* Get a {@link RedisRepository} from the given {@link Class} * Get a {@link RedisRepository} from the given {@link Class}
*
* @param clazz The class to get the repository from * @param clazz The class to get the repository from
* @return the repository * @return the repository
*/ */

@ -23,6 +23,7 @@ public class Table {
/** /**
* Create the table in the MySQL database * Create the table in the MySQL database
*
* @param mySQLController the MySQL controller * @param mySQLController the MySQL controller
* @param ignoreExisting whether or not to ignore the existing table * @param ignoreExisting whether or not to ignore the existing table
* @throws SQLException exception * @throws SQLException exception

@ -21,6 +21,7 @@ public class Column<T> {
/** /**
* Construct a new column with a name and a value. This is used when executing * Construct a new column with a name and a value. This is used when executing
* queries in a repository. * queries in a repository.
*
* @param name the name of the column * @param name the name of the column
* @param value the value in the column * @param value the value in the column
*/ */

@ -17,6 +17,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
* @return the amount of rows affected * @return the amount of rows affected
@ -27,6 +28,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
* @param onComplete the oncomplete consumer * @param onComplete the oncomplete consumer
@ -38,6 +40,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
* @param onComplete the oncomplete consumer * @param onComplete the oncomplete consumer
@ -56,6 +59,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param connection the connection to execute the query on * @param connection the connection to execute the query on
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
@ -67,6 +71,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param connection the connection to execute the query on * @param connection the connection to execute the query on
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
@ -79,6 +84,7 @@ public class MySQLRepository {
/** /**
* Insert the given columns using the provided query * Insert the given columns using the provided query
*
* @param connection the connection to execute the query on * @param connection the connection to execute the query on
* @param query the query to execute * @param query the query to execute
* @param columns the columns to insert * @param columns the columns to insert
@ -114,6 +120,7 @@ public class MySQLRepository {
/** /**
* Execute the given query * Execute the given query
*
* @param query the query to execute * @param query the query to execute
* @param columns the columns to use in the query * @param columns the columns to use in the query
* @param onComplete the oncomplete consumer * @param onComplete the oncomplete consumer
@ -124,6 +131,7 @@ public class MySQLRepository {
/** /**
* Execute the given query * Execute the given query
*
* @param query the query to execute * @param query the query to execute
* @param columns the columns to use in the query * @param columns the columns to use in the query
* @param onComplete the oncomplete consumer * @param onComplete the oncomplete consumer
@ -140,6 +148,7 @@ public class MySQLRepository {
/** /**
* Execute the given query * Execute the given query
*
* @param connection the connection to execute the query on * @param connection the connection to execute the query on
* @param query the query to execute * @param query the query to execute
* @param columns the columns to use in the query * @param columns the columns to use in the query
@ -151,6 +160,7 @@ public class MySQLRepository {
/** /**
* Execute the given query * Execute the given query
*
* @param connection the connection to execute the query on * @param connection the connection to execute the query on
* @param query the query to execute * @param query the query to execute
* @param columns the columns to use in the query * @param columns the columns to use in the query