1 /* OpenMBeanParameterInfo.java -- Open typed info about a parameter.
2 Copyright (C) 2006 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package javax.management.openmbean;
43 * Describes the parameters of a constructor or operation associated
44 * with an open management bean. This interface includes those methods
45 * specified by {@link javax.management.MBeanParameterInfo}, so
46 * implementations should extend this class.
48 * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
51 public interface OpenMBeanParameterInfo
55 * Compares this parameter with the supplied object. This returns
56 * true iff the object is an instance of {@link OpenMBeanParameterInfo}
57 * with an equal name and open type and the same default, minimum,
58 * maximum and legal values.
60 * @param obj the object to compare.
61 * @return true if the object is a {@link OpenMBeanParameterInfo}
63 * <code>name.equals(object.getName())</code>,
64 * <code>openType.equals(object.getOpenType())</code>,
65 * <code>defaultValue.equals(object.getDefaultValue())</code>,
66 * <code>minValue.equals(object.getMinValue())</code>,
67 * <code>maxValue.equals(object.getMaxValue())</code>,
68 * and <code>legalValues.equals(object.getLegalValues())</code>.
70 boolean equals(Object obj);
73 * Returns the default value of this parameter, or <code>null</code>
74 * if there is no default value.
76 * @return the default value of the parameter, or <code>null</code>
77 * if there is no default.
79 Object getDefaultValue();
82 * Returns a description of this parameter.
84 * @return a human-readable description.
86 String getDescription();
89 * Returns a {@link java.util.Set} enumerating the legal values
90 * of this parameter, or <code>null</code> if no such limited
91 * set exists for this parameter.
93 * @return a set of legal values, or <code>null</code> if no such
99 * Returns the maximum value of this parameter, or <code>null</code>
100 * if there is no maximum.
102 * @return the maximum value, or <code>null</code> if none exists.
104 Comparable getMaxValue();
107 * Returns the minimum value of this parameter, or <code>null</code>
108 * if there is no minimum.
110 * @return the minimum value, or <code>null</code> if none exists.
112 Comparable getMinValue();
115 * Returns the name of this parameter.
117 * @return the name of the parameter.
122 * Returns the open type instance which represents the type of this
125 * @return the open type of this parameter.
127 OpenType getOpenType();
130 * Returns true if this parameter has a default value.
132 * @return true if this parameter has a default.
134 boolean hasDefaultValue();
137 * Returns the hashcode of the parameter information as the sum of
138 * the hashcodes of the name, open type, default value, maximum
139 * value, minimum value and the set of legal values.
141 * @return the hashcode of the parameter information.
146 * Returns true if there is a set of legal values for this
149 * @return true if a set of legal values exists for this
152 boolean hasLegalValues();
155 * Returns true if there is a maximum value for this parameter.
157 * @return true if a maximum value exists for this parameter.
159 boolean hasMaxValue();
162 * Returns true if there is a minimum value for this parameter.
164 * @return true if a minimum value exists for this parameter.
166 boolean hasMinValue();
169 * Returns true if the specified object is a valid value for
172 * @param obj the object to test.
173 * @return true if <code>obj</code> is a valid value for this
176 boolean isValue(Object obj);
179 * Returns a textual representation of this instance. This
180 * is constructed using the class name
181 * (<code>javax.management.openmbean.OpenMBeanParameterInfo</code>)
182 * along with the name, open type, default, minimum, maximum
183 * and legal values of the parameter.
185 * @return a @link{java.lang.String} instance representing
186 * the instance in textual form.