Added special commandline argument type to support multiple strings.
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / commandline / parameterparser / parameter / IntegerParameter.java
index 6972149..7c75151 100755 (executable)
@@ -1,7 +1,7 @@
 /*
  * Svjatoslav Commons - shared library of common functionality.
  * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- * 
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 3 of the GNU Lesser General Public License
  * or later as published by the Free Software Foundation.
@@ -20,7 +20,7 @@ public class IntegerParameter extends Parameter {
 
        @Override
        public IntegerParameter addAliases(final String... aliasArray) {
-               super.addAliases(aliasArray);
+               super.addAliasesProtected(aliasArray);
                return this;
        }
 
@@ -29,7 +29,8 @@ public class IntegerParameter extends Parameter {
                return "integer";
        }
 
-       public int getValue() {
+       @Override
+       public Integer getValue() {
                if (arguments.size() != 1)
                        throw new RuntimeException("Parameter " + description
                                        + " shall have exactly 1 argument.");
@@ -38,7 +39,7 @@ public class IntegerParameter extends Parameter {
 
        @Override
        public IntegerParameter setMandatory() {
-               mandatory = true;
+               setMandatoryProtected();
                return this;
        }
 
@@ -51,5 +52,4 @@ public class IntegerParameter extends Parameter {
                        return false;
                }
        }
-
 }