|
21 | 21 | import java.util.regex.Matcher; |
22 | 22 | import java.util.regex.Pattern; |
23 | 23 |
|
24 | | -class KyuubiCtlOptionParser { |
| 24 | +abstract class KyuubiCtlOptionParser { |
25 | 25 | protected final String ZK_ADDRESS = "--zkAddress"; |
26 | 26 | protected final String NAMESPACE = "--namespace"; |
27 | 27 | protected final String USER = "--user"; |
@@ -62,9 +62,7 @@ class KyuubiCtlOptionParser { |
62 | 62 | * |
63 | 63 | * @return offset of remaining arguments. |
64 | 64 | */ |
65 | | - protected int parseActionAndService(List<String> args) { |
66 | | - throw new UnsupportedOperationException(); |
67 | | - } |
| 65 | + protected abstract int parseActionAndService(List<String> args); |
68 | 66 |
|
69 | 67 | /** |
70 | 68 | * Parse a list of kyuubi-ctl command line options. |
@@ -124,19 +122,15 @@ protected final void parse(List<String> args) { |
124 | 122 | * @param value The value. This will be <i>null</i> if the option does not take a value. |
125 | 123 | * @return Whether to continue parsing the argument list. |
126 | 124 | */ |
127 | | - protected boolean handle(String opt, String value) { |
128 | | - throw new UnsupportedOperationException(); |
129 | | - } |
| 125 | + protected abstract boolean handle(String opt, String value); |
130 | 126 |
|
131 | 127 | /** |
132 | 128 | * Callback for when an unrecognized option is parsed. |
133 | 129 | * |
134 | 130 | * @param opt Unrecognized option from the command line. |
135 | 131 | * @return Whether to continue parsing the argument list. |
136 | 132 | */ |
137 | | - protected boolean handleUnknown(String opt) { |
138 | | - throw new UnsupportedOperationException(); |
139 | | - } |
| 133 | + protected abstract boolean handleUnknown(String opt); |
140 | 134 |
|
141 | 135 | private String findCliOption(String name, String[][] available) { |
142 | 136 | for (String[] candidates : available) { |
|
0 commit comments