Apply suggestions from code review

Co-authored-by: CyB3RC0nN0R <kske@outlook.de>
This commit is contained in:
delvh
2020-08-23 13:39:31 +02:00
parent c784ebb787
commit ddbf9acd07
9 changed files with 73 additions and 107 deletions

View File

@ -32,9 +32,9 @@ public final class ClientConfig extends Config {
private ClientConfig() {
super(".envoy");
put("server", "s", identity(), true);
put("port", "p", Integer::parseInt, true);
put("localDB", "db", File::new, true);
put("server", "s", identity());
put("port", "p", Integer::parseInt);
put("localDB", "db", File::new);
put("ignoreLocalDB", "nodb", Boolean::parseBoolean);
put("user", "u", identity());
put("password", "pw", identity());
@ -62,10 +62,7 @@ public final class ClientConfig extends Config {
* @return {@code true} if the local database is to be ignored
* @since Envoy Client v0.3-alpha
*/
public Boolean isIgnoreLocalDB() {
final var ignoreLocalDB = items.get("ignoreLocalDB").get();
return ignoreLocalDB != null && (Boolean) ignoreLocalDB;
}
public Boolean isIgnoreLocalDB() { return (Boolean) items.get("ignoreLocalDB").get(); }
/**
* @return the user name