/*
* Svjatoslav Commons - shared library of common functionality.
- * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright ©2012-2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
// save aliases
{
final ArrayList<String> aliasesList = new ArrayList<String>();
- for (final String alias : aliases) {
+ for (final String alias : aliases)
aliasesList.add(alias);
- }
this.aliases = aliasesList;
}
}
public File getArgumentAsFile() {
- if (arguments.size() != 1) {
+ if (arguments.size() != 1)
throw new RuntimeException("Parameter " + description
+ " shall have exactly 1 argument.");
- }
return new File(arguments.get(0));
}
public int getArgumentAsInteger() {
- if (arguments.size() != 1) {
+ if (arguments.size() != 1)
throw new RuntimeException("Parameter " + description
+ " shall have exactly 1 argument.");
- }
return Integer.parseInt(arguments.get(0));
}
public String getArgumentAsString() {
- if (arguments.size() != 1) {
+ if (arguments.size() != 1)
throw new RuntimeException("Parameter " + description
+ " shall have exactly 1 argument.");
- }
return arguments.get(0);
}
public List<Integer> getArgumentsAsIntegers() {
final ArrayList<Integer> result = new ArrayList<Integer>();
- for (final String argument : arguments) {
+ for (final String argument : arguments)
result.add(Integer.valueOf(argument));
- }
return result;
}
if (enableArguments) {
buffer.append(" (" + argumentType.describeFormat() + ")");
- if (enableMultipleArguments) {
+ if (enableMultipleArguments)
buffer.append("...");
- }
}
buffer.append("\n");