DiagnosticCommand.java revision 1265:c82ea5393dda
1219089Spjd/*
2209962Smm * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
3209962Smm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4209962Smm *
5209962Smm * This code is free software; you can redistribute it and/or modify it
6209962Smm * under the terms of the GNU General Public License version 2 only, as
7209962Smm * published by the Free Software Foundation.
8209962Smm *
9209962Smm * This code is distributed in the hope that it will be useful, but WITHOUT
10209962Smm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11209962Smm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12209962Smm * version 2 for more details (a copy is included in the LICENSE file that
13209962Smm * accompanied this code).
14209962Smm *
15209962Smm * You should have received a copy of the GNU General Public License version
16209962Smm * 2 along with this work; if not, write to the Free Software Foundation,
17209962Smm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18209962Smm *
19209962Smm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20209962Smm * or visit www.oracle.com if you need additional information or have any
21209962Smm * questions.
22219089Spjd */
23263407Sdelphij
24209962Smmpackage sun.hotspot.parser;
25209962Smm
26209962Smmpublic class DiagnosticCommand {
27209962Smm
28209962Smm    public enum DiagnosticArgumentType {
29209962Smm        JLONG, BOOLEAN, STRING, NANOTIME, STRINGARRAY, MEMORYSIZE
30209962Smm    }
31209962Smm
32209962Smm    private String name;
33209962Smm    private String desc;
34209962Smm    private DiagnosticArgumentType type;
35209962Smm    private boolean mandatory;
36209962Smm    private String defaultValue;
37209962Smm    private boolean argument;
38209962Smm
39209962Smm    public DiagnosticCommand(String name, String desc, DiagnosticArgumentType type,
40209962Smm            boolean mandatory, String defaultValue) {
41209962Smm        this(name, desc, type, false, mandatory, defaultValue);
42209962Smm    }
43209962Smm
44209962Smm    public DiagnosticCommand(String name, String desc, DiagnosticArgumentType type,
45209962Smm            boolean argument, boolean mandatory, String defaultValue) {
46209962Smm        this.name = name;
47209962Smm        this.desc = desc;
48209962Smm        this.type = type;
49209962Smm        this.mandatory = mandatory;
50209962Smm        this.defaultValue = defaultValue;
51209962Smm        this.argument = argument;
52209962Smm    }
53209962Smm
54209962Smm    public String getName() {
55209962Smm        return name;
56209962Smm    }
57209962Smm
58209962Smm    public String getDesc() {
59209962Smm        return desc;
60209962Smm    }
61209962Smm
62209962Smm    public DiagnosticArgumentType getType() {
63209962Smm        return type;
64209962Smm    }
65209962Smm
66209962Smm    public boolean isMandatory() {
67209962Smm        return mandatory;
68209962Smm    }
69209962Smm
70209962Smm    public boolean isArgument() {
71209962Smm        return argument;
72209962Smm    }
73209962Smm
74209962Smm    public String getDefaultValue() {
75209962Smm        return defaultValue;
76209962Smm    }
77209962Smm}
78209962Smm