Package: CommandDescriptor

CommandDescriptor

nameinstructionbranchcomplexitylinemethod
CommandDescriptor(String, String, Method, Object)
M: 15 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
getCommandName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMethod()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSubCommandName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTarget()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 22 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2008, 2010 VMware Inc.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * VMware Inc. - initial contribution
10: *******************************************************************************/
11:
12: package org.eclipse.virgo.shell.internal;
13:
14: import java.lang.reflect.Method;
15:
16: /**
17: * A <code>CommandDescriptor</code> describes a command that is known to the Shell.
18: * <p />
19: *
20: * <strong>Concurrent Semantics</strong><br />
21: * Thread-safe.
22: *
23: */
24: public final class CommandDescriptor {
25:
26: private final String commandName;
27:
28: private final String subCommandName;
29:
30: private final Method method;
31:
32: private final Object target;
33:
34: CommandDescriptor(String commandName, String subCommandName, Method method, Object target) {
35: this.commandName = commandName;
36: this.subCommandName = subCommandName;
37: this.method = method;
38: this.target = target;
39: }
40:
41: public String toString() {
42: StringBuilder builder = new StringBuilder();
43: builder.append(commandName).append(" ").append(subCommandName).append(" ").append(method);
44: return builder.toString();
45: }
46:
47: public String getCommandName() {
48: return commandName;
49: }
50:
51:
52: public String getSubCommandName() {
53: return subCommandName;
54: }
55:
56: public Method getMethod() {
57: return method;
58: }
59:
60: public Object getTarget() {
61: return target;
62: }
63: }