Last change
on this file since 639 was
639,
checked in by sherbold, 12 years ago
|
- all usages of the Console tracing API now define log levels
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.4 KB
|
Rev | Line | |
---|
[432] | 1 | package de.ugoe.cs.quest;
|
---|
[240] | 2 |
|
---|
[639] | 3 | import java.util.logging.Level;
|
---|
| 4 |
|
---|
[240] | 5 | import 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 | */
|
---|
| 15 | public 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) {
|
---|
[639] | 54 | Console.traceln(Level.INFO, "Existing object " + objectName + " overwritten.");
|
---|
[240] | 55 | }
|
---|
| 56 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.