Skip to content

Commit b254d8e

Browse files
committed
Deprecate the ConsoleUtils utility class
All of its needed functionality moved elsewhere.
1 parent 001b3dd commit b254d8e

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

src/main/java/org/scijava/console/ConsoleUtils.java

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,32 @@
3939
import org.scijava.log.LogService;
4040
import org.scijava.module.ModuleInfo;
4141
import org.scijava.module.ModuleItem;
42+
import org.scijava.parse.ParseService;
4243

43-
/**
44-
* Helper class for {@link ConsoleArgument}s.
45-
*
46-
* @author Mark Hiner
47-
*/
44+
/** @deprecated Use alternatives instead (see individual method docs). */
45+
@Deprecated
4846
public final class ConsoleUtils {
4947

50-
/**
51-
* @see #parseParameterString(String, ModuleInfo, LogService)
52-
*/
48+
/** @deprecated Use {@link ParseService} instead. */
49+
@Deprecated
5350
public static Map<String, Object> parseParameterString(final String parameterString) {
5451
return parseParameterString(parameterString, (CommandInfo)null);
5552
}
5653

57-
/**
58-
* @see #parseParameterString(String, ModuleInfo, LogService)
59-
*/
54+
/** @deprecated Use {@link ParseService} instead. */
55+
@Deprecated
6056
public static Map<String, Object> parseParameterString(final String parameterString, final ModuleInfo info) {
6157
return parseParameterString(parameterString, info, null);
6258
}
6359

64-
/**
65-
* @see #parseParameterString(String, ModuleInfo, LogService)
66-
*/
60+
/** @deprecated Use {@link ParseService} instead. */
61+
@Deprecated
6762
public static Map<String, Object> parseParameterString(final String parameterString, final LogService log) {
6863
return parseParameterString(parameterString, null, log);
6964
}
7065

71-
/**
72-
* Helper method for turning a parameter string into a {@code Map} of
73-
* key:value pairs. If a {@link ModuleInfo} is provided, the parameter
74-
* string is assumed to be a comma-separated list of values, ordered
75-
* according to the {@code ModuleInfo's} inputs. Otherwise, the parameter
76-
* string is assumed to be a comma-separated list of "key=value" pairs.
77-
*
78-
* TODO reconcile with attribute parsing of {@link ScriptInfo}
79-
*/
66+
/** @deprecated Use {@link ParseService} instead. */
67+
@Deprecated
8068
public static Map<String, Object> parseParameterString(final String parameterString, final ModuleInfo info, final LogService log) {
8169
final Map<String, Object> inputMap = new HashMap<String, Object>();
8270

@@ -104,12 +92,10 @@ else if (log != null)
10492
}
10593

10694
/**
107-
* Test if the next argument is an appropriate parameter to a
108-
* {@link ConsoleArgument}.
109-
*
110-
* @return {@code true} if the first argument of the given list does not
111-
* start with a {@code '-'} character.
95+
* @deprecated Use {@link AbstractConsoleArgument#getParam(LinkedList)}
96+
* instead.
11297
*/
98+
@Deprecated
11399
public static boolean hasParam(final LinkedList<String> args) {
114100
return !(args.isEmpty() || args.getFirst().startsWith("-"));
115101
}

0 commit comments

Comments
 (0)