Added Javadoc to Config file.

This commit is contained in:
leon 2019-10-12 11:52:29 +02:00
parent 5ce2d87793
commit c2c5b6e105

View File

@ -15,11 +15,25 @@ public class Config {
private String server; private String server;
private int port; private int port;
/**
* Defaults to the {@code server.properties} file for information.
*
*
* @param properties - The two options for internet connection <strong> server</strong> and <strong> port</strong>
* @since Envoy 0.1
*/
public void load(Properties properties) { public void load(Properties properties) {
if (properties.containsKey("server")) server = properties.getProperty("server"); if (properties.containsKey("server")) server = properties.getProperty("server");
if (properties.containsKey("port")) port = Integer.parseInt(properties.getProperty("port")); if (properties.containsKey("port")) port = Integer.parseInt(properties.getProperty("port"));
} }
/**
* Sets the server and the port via command line properties --server/ -s and --port/ -p.
*
* @param args {@code --server} or {@code -s} followed by the specified URL
* and {@code --port} or {@code -p} followed by a 4-digit Integer
* @since Envoy 0.1
*/
public void load(String[] args) { public void load(String[] args) {
for (int i = 0; i < args.length; i++) for (int i = 0; i < args.length; i++)
switch (args[i]) { switch (args[i]) {