Implement JavaDocs
All checks were successful
continuous-integration/drone/push Build is passing

JavaDocs can be generated with mvn javadoc:javadoc and will be available in target/site/apidocs.
This commit is contained in:
Bea 2022-08-26 16:25:41 +02:00
parent 70570624e1
commit aa223df480
3 changed files with 58 additions and 25 deletions

View File

@ -33,7 +33,8 @@
</dependencies>
<build>
<plugins><plugin>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
@ -56,6 +57,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
</plugin>
</plugins>
</build>

View File

@ -30,7 +30,11 @@ public class Logger
className = logClass.getSimpleName();
}
// log a message to console, with our chosen format
/**
* Logs a message to console, following a specific format.
*
* @param message the message to log
*/
public void log(String message)
{
LocalDateTime now = LocalDateTime.now();
@ -43,7 +47,12 @@ public class Logger
.replace("%message%", message));
}
// log a message to console after delaying it (in seconds).
/**
* Logs a message to console, after delaying it.
*
* @param message the message to log
* @param delay the time to wait before logging, in seconds
*/
public void log(String message, int delay)
{
// create a new scheduled executor with an anonymous runnable...
@ -52,12 +61,21 @@ public class Logger
}
// avoid formatting the text and print whatever is passed.
/**
* Prints a message to console without any formatting.
*
* @param message the message to log
*/
public void logRaw(String message)
{
System.out.println(message);
}
/**
* Returns ASCII art saying the bot name.
*
* @return a String containing the logo
*/
public String getLogo()
{
return logo;

View File

@ -6,6 +6,14 @@ public class RandomUtil
{
private static final Random random = new Random();
/**
* Returns a random integer picked in a range.
*
* @param min the minimum value (inclusive)
* @param max the maximum value (inclusive)
* @return a random number in range [min; max]
*/
public static int getRandomNumber(int min, int max)
{
if(min == max) return min; // dumbass