It would be nice to add overload of getKey method so you can use something like this: this.optionalkey = config.getKey("key1", "defaultValue"); it's need for set default value if needed value can't be found on config.