| 1 | // jademx - JADE management using JMX |
| 2 | // Copyright 2005 Caboodle Networks, Inc. |
| 3 | // |
| 4 | // This library is free software; you can redistribute it and/or |
| 5 | // modify it under the terms of the GNU Lesser General Public |
| 6 | // License as published by the Free Software Foundation; either |
| 7 | // version 2.1 of the License, or (at your option) any later version. |
| 8 | // |
| 9 | // This library is distributed in the hope that it will be useful, |
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | // Lesser General Public License for more details. |
| 13 | // |
| 14 | // You should have received a copy of the GNU Lesser General Public |
| 15 | // License along with this library; if not, write to the Free Software |
| 16 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 | |
| 18 | package jade.jademx.config.jademx.onto; |
| 19 | |
| 20 | import jade.content.Concept; |
| 21 | |
| 22 | /** |
| 23 | * Class to represent an argument to an agent in the JademxConfigOntology. |
| 24 | * @author David Bernstein, <a href="http://www.caboodlenetworks.com" |
| 25 | * >Caboodle Networks, Inc.</a> |
| 26 | */ |
| 27 | public class ConfigArgument implements Concept { |
| 28 | |
| 29 | /** value of argument */ |
| 30 | private String value = null; |
| 31 | /** optional class of argument (default to String) */ |
| 32 | private String classname = null; |
| 33 | |
| 34 | /** |
| 35 | * Constructor |
| 36 | */ |
| 37 | public ConfigArgument() { |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * make Argument with value |
| 42 | * @param value argument value |
| 43 | */ |
| 44 | public ConfigArgument( String value ) { |
| 45 | this( value, null ); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * make Argument with value and classname |
| 50 | * @param value argument value |
| 51 | * @param classname argument classname |
| 52 | */ |
| 53 | public ConfigArgument( String value, String classname ) { |
| 54 | setValue( value ); |
| 55 | setClassname( classname ); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @return Returns the value. |
| 60 | */ |
| 61 | public String getValue() { |
| 62 | return value; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * @param value The value to set. |
| 67 | */ |
| 68 | public void setValue(String value) { |
| 69 | this.value = value; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * @return Returns the classname. |
| 74 | */ |
| 75 | public String getClassname() { |
| 76 | return classname; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * @param classname The classname to set. |
| 81 | */ |
| 82 | public void setClassname(String classname) { |
| 83 | this.classname = classname; |
| 84 | } |
| 85 | |
| 86 | |
| 87 | /* (non-Javadoc) |
| 88 | * @see java.lang.Object#toString() |
| 89 | */ |
| 90 | public String toString() { |
| 91 | return "Argument[\""+value+"\""+((null==classname)?"":(","+classname))+"]"; |
| 92 | } |
| 93 | } |