- * modify it under the terms of version 2 of the GNU General Public License
- * as published by the Free Software Foundation.
- */
+ * 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.meviz.encoder;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
package eu.svjatoslav.meviz.encoder;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
- public BitrateParameter(String description) {
- super(description, ArgumentCount.SINGLE);
- }
+ public BitrateParameter(final String description) {
+ super(description, ArgumentCount.SINGLE);
+ }
- @Override
- public boolean validate(final String value) {
- try {
- bitrate.valueOf(value);
- } catch (final IllegalArgumentException exception) {
- return false;
- }
+ @Override
+ public Bitrate getValue() {
+ return Bitrate.valueOf(arguments.get(0).toUpperCase());
+ }
- public bitrate getValue() {
- return bitrate.valueOf(getArgumentsAsStrings().get(0).toUpperCase());
- }
+ public enum Bitrate {
+ NONE, LOW, MEDIUM, HIGH, COPY
+ }