code cleanup and formatting
[meviz.git] / src / main / java / eu / svjatoslav / meviz / encoder / BitrateParameter.java
index 168f2b4..30a6712 100755 (executable)
@@ -1,7 +1,7 @@
 /*
  * Meviz - Various tools collection to work with multimedia.
  * Copyright (C) 2012, 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
  * as published by the Free Software Foundation.
@@ -12,33 +12,34 @@ package eu.svjatoslav.meviz.encoder;
 import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
 import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
 
-public class BitrateParameter extends Parameter {
+public class BitrateParameter extends Parameter<BitrateParameter> {
 
-       public BitrateParameter(String description) {
-               super(description, ArgumentCount.SINGLE);
-       }
+    public BitrateParameter(final String description) {
+        super(description, ArgumentCount.SINGLE);
+    }
 
-       @Override
-       public String describeFormat() {
-               return "Target bitrate [LOW / MEDIUM / HIGH / COPY]";
-       }
+    @Override
+    public String describeFormat() {
+        return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY ]";
+    }
 
-       @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());
+    }
 
-               return true;
-       }
+    @Override
+    public boolean validate(final String value) {
+        try {
+            bitrate.valueOf(value.toUpperCase());
+        } catch (final IllegalArgumentException exception) {
+            return false;
+        }
 
-       static public enum bitrate {
-               LOW, MEDIUM, HIGH, COPY
-       };
+        return true;
+    }
 
-       public bitrate getValue() {
-               return bitrate.valueOf(getArgumentsAsStrings().get(0).toUpperCase());
-       }
+    public enum bitrate {
+        NONE, LOW, MEDIUM, HIGH, COPY
+    }
 }