fixed copyright headers
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / commandline / parameterparser / Parameter.java
index 1575fcf..1e738a5 100755 (executable)
@@ -1,6 +1,6 @@
 /*
  * 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
@@ -51,9 +51,8 @@ public class Parameter {
                // 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;
                }
 
@@ -112,26 +111,23 @@ public class Parameter {
        }
 
        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);
        }
 
@@ -149,9 +145,8 @@ public class Parameter {
        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;
        }
@@ -169,9 +164,8 @@ public class Parameter {
                if (enableArguments) {
                        buffer.append(" (" + argumentType.describeFormat() + ")");
 
-                       if (enableMultipleArguments) {
+                       if (enableMultipleArguments)
                                buffer.append("...");
-                       }
                }
                buffer.append("\n");