+/*
+ * Svjatoslav Commons - shared library of common functionality.
+ * Copyright ©2012-2017, 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.
+ */
+
package eu.svjatoslav.commons.commandline.parameterparser.parameter;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
-public class NullParameter extends Parameter {
-
- public NullParameter(final String description) {
- super(description, ArgumentCount.NONE);
- }
-
- @Override
- public NullParameter addAliases(final String... aliasArray) {
- super.addAliases(aliasArray);
- return this;
- }
-
- public boolean getValue() {
- return isParameterSpecified();
- }
-
- @Override
- public NullParameter setMandatory() {
- mandatory = true;
- return this;
- }
-
- @Override
- public java.lang.String describeFormat() {
- return "<none>";
- }
-
- @Override
- public boolean validate(final java.lang.String value) {
- return true;
- }
+public class NullParameter extends Parameter<Boolean, NullParameter> {
+
+ public NullParameter(final String description) {
+ super(description, ArgumentCount.NONE);
+ }
+
+ @Override
+ public java.lang.String describeFormat() {
+ return "<none>";
+ }
+
+ @Override
+ public Boolean getValue() {
+ return isSpecified();
+ }
+
+ @Override
+ public boolean validate(final java.lang.String value) {
+ return true;
+ }
}