Adds and improves comments for server types and profile

This commit is contained in:
Kristian Knarvik 2020-08-19 10:39:24 +02:00
parent e71e95df7f
commit d06cf4114a
11 changed files with 41 additions and 19 deletions

View File

@ -12,7 +12,7 @@ import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* Contains all user settings, and a list of servers. * Keeps track of a set of servers and some user settings
* *
* @author Kristian Knarvik <kristian.knarvik@knett.no> * @author Kristian Knarvik <kristian.knarvik@knett.no>
* @version 1.0.0 * @version 1.0.0
@ -65,7 +65,7 @@ public class Profile {
/** /**
* Gets whether the software should keep running in the background * Gets whether the software should keep running in the background
* *
* @return <p>Whether the software should keep running in the backgound</p> * @return <p>Whether the software should keep running in the background</p>
*/ */
public boolean getRunInBackground() { public boolean getRunInBackground() {
return this.runInBackground; return this.runInBackground;
@ -83,7 +83,7 @@ public class Profile {
/** /**
* Gets the number of seconds to delay startup * Gets the number of seconds to delay startup
* *
* @return <p>The number of seconds to delay starup</p> * @return <p>The number of seconds to delay startup</p>
*/ */
public int getDelayStartup() { public int getDelayStartup() {
return this.delayStartup; return this.delayStartup;
@ -119,10 +119,10 @@ public class Profile {
} }
/** /**
* Gets a Collection object by name. * Gets a collection given its name
* *
* @param name The name of the collection. * @param name <p>The name of the collection to get</p>
* @return A collection object. * @return <p>A collection or null if no collection exists with the given name</p>
*/ */
public Collection getCollection(String name) { public Collection getCollection(String name) {
for (Collection collection : this.collections) { for (Collection collection : this.collections) {
@ -134,9 +134,9 @@ public class Profile {
} }
/** /**
* Adds a collection to the profile if the name is valid. * Adds a collection to the profile if the name is valid
* *
* @param name The name of the collection and its elements. * @param name <p>The name of the collection and its elements</p>
*/ */
public void addCollection(String name) throws ConfigurationException { public void addCollection(String name) throws ConfigurationException {
if (name == null) { //If a user cancels or crosses out window if (name == null) { //If a user cancels or crosses out window
@ -247,4 +247,5 @@ public class Profile {
} }
return profile; return profile;
} }
} }

View File

@ -10,6 +10,9 @@ import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.down
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile;
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween;
/**
* This class represents the BungeeCord proxy server type
*/
public class BungeeCord extends AbstractServerType { public class BungeeCord extends AbstractServerType {
private final String versionURL; private final String versionURL;

View File

@ -13,7 +13,7 @@ public class CraftBukkit extends AbstractServerType {
private final String downloadURLPart; private final String downloadURLPart;
/** /**
* Instantiates a new server type * Instantiates a new CraftBukkit server type
* *
* @param typeName <p>The name of the server type</p> * @param typeName <p>The name of the server type</p>
* @param isProxy <p>Whether this server type is a proxy server</p> * @param isProxy <p>Whether this server type is a proxy server</p>

View File

@ -4,7 +4,7 @@ import java.io.File;
public class Custom extends AbstractServerType { public class Custom extends AbstractServerType {
/** /**
* Instantiates a new server type * Instantiates a new custom server type
* *
* @param typeName <p>The name of the server type</p> * @param typeName <p>The name of the server type</p>
*/ */

View File

@ -1,9 +1,12 @@
package net.knarcraft.minecraftserverlauncher.server.servertypes; package net.knarcraft.minecraftserverlauncher.server.servertypes;
/**
* This class represents the MCPC+ Minecraft server type
*/
public class MCPCPlus extends CraftBukkit { public class MCPCPlus extends CraftBukkit {
/** /**
* Instantiates a new server type * Instantiates a new MCPCplus server type
* *
* @param typeName <p>The name of the server type</p> * @param typeName <p>The name of the server type</p>
* @param isProxy <p>Whether this server type is a proxy server</p> * @param isProxy <p>Whether this server type is a proxy server</p>

View File

@ -1,11 +1,14 @@
package net.knarcraft.minecraftserverlauncher.server.servertypes; package net.knarcraft.minecraftserverlauncher.server.servertypes;
/**
* This class represents the Paper Minecraft server type
*/
public class Paper extends Spigot { public class Paper extends Spigot {
/** /**
* Instantiates a new server type * Instantiates a new Paper server type
* *
* @param typeName <p>The typeName of the server type</p> * @param typeName <p>The name of the server type</p>
* @param isProxy <p>Whether this server type is a proxy server</p> * @param isProxy <p>Whether this server type is a proxy server</p>
* @param versions <p>A list of one or more server versions for the type</p> * @param versions <p>A list of one or more server versions for the type</p>
* @param downloadURL <p>The URL used for downloading .jar files</p> * @param downloadURL <p>The URL used for downloading .jar files</p>

View File

@ -1,11 +1,14 @@
package net.knarcraft.minecraftserverlauncher.server.servertypes; package net.knarcraft.minecraftserverlauncher.server.servertypes;
/**
* This class represents the CraftBukkit Minecraft server type
*/
public class Spigot extends CraftBukkit { public class Spigot extends CraftBukkit {
/** /**
* Instantiates a new server type * Instantiates a new Spigot server type
* *
* @param typeName <p>The typeName of the server type</p> * @param typeName <p>The name of the server type</p>
* @param isProxy <p>Whether this server type is a proxy server</p> * @param isProxy <p>Whether this server type is a proxy server</p>
* @param versions <p>A list of one or more server versions for the type</p> * @param versions <p>A list of one or more server versions for the type</p>
* @param downloadURL <p>The URL used for downloading .jar files</p> * @param downloadURL <p>The URL used for downloading .jar files</p>

View File

@ -9,6 +9,9 @@ import java.nio.file.Paths;
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.downloadFile; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.downloadFile;
/**
* This class represents the SpongeVanilla Minecraft server type
*/
public class SpongeVanilla extends AbstractServerType { public class SpongeVanilla extends AbstractServerType {
private final String versionURL; private final String versionURL;

View File

@ -2,6 +2,9 @@ package net.knarcraft.minecraftserverlauncher.server.servertypes;
import net.knarcraft.minecraftserverlauncher.server.ServerVersionContainer; import net.knarcraft.minecraftserverlauncher.server.ServerVersionContainer;
/**
* This class represents the Travertine proxy server type
*/
public class Travertine extends Waterfall { public class Travertine extends Waterfall {
/** /**

View File

@ -15,7 +15,7 @@ import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.down
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile;
/** /**
* This class represents the regular vanilla server type * This class represents the regular vanilla Minecraft server type
*/ */
public class Vanilla extends AbstractServerType { public class Vanilla extends AbstractServerType {

View File

@ -11,6 +11,9 @@ import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.down
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.readFile;
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween;
/**
* This class represents the Travertine proxy server type
*/
public class Waterfall extends AbstractServerType { public class Waterfall extends AbstractServerType {
private final String srcStart; private final String srcStart;