| 1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany
|
|---|
| 2 | //
|
|---|
| 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
|---|
| 4 | // you may not use this file except in compliance with the License.
|
|---|
| 5 | // You may obtain a copy of the License at
|
|---|
| 6 | //
|
|---|
| 7 | // http://www.apache.org/licenses/LICENSE-2.0
|
|---|
| 8 | //
|
|---|
| 9 | // Unless required by applicable law or agreed to in writing, software
|
|---|
| 10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
|---|
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|---|
| 12 | // See the License for the specific language governing permissions and
|
|---|
| 13 | // limitations under the License.
|
|---|
| 14 |
|
|---|
| 15 | package de.ugoe.cs.autoquest;
|
|---|
| 16 |
|
|---|
| 17 | import java.util.logging.Level;
|
|---|
| 18 |
|
|---|
| 19 | import de.ugoe.cs.util.console.Console;
|
|---|
| 20 |
|
|---|
| 21 | /**
|
|---|
| 22 | * <p>
|
|---|
| 23 | * Helper class that collects methods that are often used by the commands.
|
|---|
| 24 | * </p>
|
|---|
| 25 | *
|
|---|
| 26 | * @author Steffen Herbold
|
|---|
| 27 | * @version 1.0
|
|---|
| 28 | */
|
|---|
| 29 | public class CommandHelpers {
|
|---|
| 30 |
|
|---|
| 31 | /**
|
|---|
| 32 | * <p>
|
|---|
| 33 | * Prints a message to error stream of the {@link Console} that an object
|
|---|
| 34 | * has not been found in the storage.
|
|---|
| 35 | * </p>
|
|---|
| 36 | *
|
|---|
| 37 | * @param objectName
|
|---|
| 38 | * name of the object
|
|---|
| 39 | */
|
|---|
| 40 | public static void objectNotFoundMessage(String objectName) {
|
|---|
| 41 | Console.printerrln("Object " + objectName + " not found in storage.");
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | /**
|
|---|
| 45 | * <p>
|
|---|
| 46 | * Prints a message to the error stream of the {@link Console} that an
|
|---|
| 47 | * object is not of an expected type.
|
|---|
| 48 | * </p>
|
|---|
| 49 | *
|
|---|
| 50 | * @param objectName
|
|---|
| 51 | * name of the object
|
|---|
| 52 | * @param type
|
|---|
| 53 | * expected type
|
|---|
| 54 | */
|
|---|
| 55 | public static void objectNotType(String objectName, String type) {
|
|---|
| 56 | Console.printerrln("Object " + objectName + " not of type " + type + ".");
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | /**
|
|---|
| 60 | * <p>
|
|---|
| 61 | * Prints a message to the trace stream of the {@link Console} that an
|
|---|
| 62 | * object in the storage has been overwritten.
|
|---|
| 63 | * </p>
|
|---|
| 64 | *
|
|---|
| 65 | * @param objectName
|
|---|
| 66 | */
|
|---|
| 67 | public static void dataOverwritten(String objectName) {
|
|---|
| 68 | Console.traceln(Level.INFO, "Existing object " + objectName + " overwritten.");
|
|---|
| 69 | }
|
|---|
| 70 | }
|
|---|