source: trunk/autoquest-misc/src/main/java/de/ugoe/cs/quest/CommandHelpers.java @ 914

Last change on this file since 914 was 671, checked in by sherbold, 12 years ago
  • moved CommandHelpers? from quest-ui-core to quest-misc
  • removed dependency on quest-ui-core from all quest-plugin projects
  • Property svn:mime-type set to text/plain
File size: 1.4 KB
Line 
1package de.ugoe.cs.quest;
2
3import java.util.logging.Level;
4
5import de.ugoe.cs.util.console.Console;
6
7/**
8 * <p>
9 * Helper class that collects methods that are often used by the commands.
10 * </p>
11 *
12 * @author Steffen Herbold
13 * @version 1.0
14 */
15public class CommandHelpers {
16
17        /**
18         * <p>
19         * Prints a message to error stream of the {@link Console} that an object
20         * has not been found in the storage.
21         * </p>
22         *
23         * @param objectName
24         *            name of the object
25         */
26        public static void objectNotFoundMessage(String objectName) {
27                Console.printerrln("Object " + objectName + " not found in storage.");
28        }
29
30        /**
31         * <p>
32         * Prints a message to the error stream of the {@link Console} that an
33         * object is not of an expected type.
34         * </p>
35         *
36         * @param objectName
37         *            name of the object
38         * @param type
39         *            expected type
40         */
41        public static void objectNotType(String objectName, String type) {
42                Console.printerrln("Object " + objectName + "not of type " + type + ".");
43        }
44
45        /**
46         * <p>
47         * Prints a message to the trace stream of the {@link Console} that an
48         * object in the storage has been overwritten.
49         * </p>
50         *
51         * @param objectName
52         */
53        public static void dataOverwritten(String objectName) {
54                Console.traceln(Level.INFO, "Existing object " + objectName + " overwritten.");
55        }
56}
Note: See TracBrowser for help on using the repository browser.