File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public class Option implements Cloneable, Serializable
6969 private int numberOfArgs = UNINITIALIZED ;
7070
7171 /** the type of this Option */
72- private Class type = String .class ;
72+ private Class <?> type = String .class ;
7373
7474 /** the list of argument values **/
7575 private List <String > values = new ArrayList <String >();
@@ -188,6 +188,21 @@ public Object getType()
188188 return type ;
189189 }
190190
191+ /**
192+ * Sets the type of this Option.
193+ * <p>
194+ * <b>Note:</b> this method is kept for binary compatibility and the
195+ * input type is supposed to be a {@link Class} object.
196+ *
197+ * @param type the type of this Option
198+ * @deprecated since 1.3, use {@link #setType(Class)} instead
199+ */
200+ @ Deprecated
201+ public void setType (Object type )
202+ {
203+ setType ((Class ) type );
204+ }
205+
191206 /**
192207 * Sets the type of this Option.
193208 *
Original file line number Diff line number Diff line change @@ -280,6 +280,23 @@ public static OptionBuilder hasOptionalArgs(int numArgs)
280280 return instance ;
281281 }
282282
283+ /**
284+ * The next Option created will have a value that will be an instance
285+ * of <code>type</code>.
286+ * <p>
287+ * <b>Note:</b> this method is kept for binary compatibility and the
288+ * input type is supposed to be a {@link Class} object.
289+ *
290+ * @param newType the type of the Options argument value
291+ * @return the OptionBuilder instance
292+ * @deprecated since 1.3, use {@link #withType(Class)} instead
293+ */
294+ @ Deprecated
295+ public static OptionBuilder withType (Object newType )
296+ {
297+ return withType ((Class ) newType );
298+ }
299+
283300 /**
284301 * The next Option created will have a value that will be an instance
285302 * of <code>type</code>.
You can’t perform that action at this time.
0 commit comments