KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > openmbean > OpenMBeanParameterInfo


1 /*
2  * @(#)OpenMBeanParameterInfo.java 3.21 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8
9 package javax.management.openmbean;
10
11
12 // java import
13
//
14
import java.util.Set JavaDoc;
15 import java.lang.Comparable JavaDoc; // to be substituted for jdk1.1.x
16

17
18 // jmx import
19
//
20

21
22 /**
23  * <p>Describes a parameter used in one or more operations or
24  * constructors of an open MBean.</p>
25  *
26  * <p>This interface declares the same methods as the class {@link
27  * javax.management.MBeanParameterInfo}. A class implementing this
28  * interface (typically {@link OpenMBeanParameterInfoSupport}) should
29  * extend {@link javax.management.MBeanParameterInfo}.</p>
30  *
31  * @version 3.21 03/12/19
32  * @author Sun Microsystems, Inc.
33  *
34  * @since 1.5
35  * @since.unbundled JMX 1.1
36  */

37 public interface OpenMBeanParameterInfo {
38
39
40     // Re-declares methods that are in class MBeanParameterInfo of JMX 1.0
41
// (these will be removed when MBeanParameterInfo is made a parent interface of this interface)
42

43     /**
44      * Returns a human readable description of the parameter
45      * described by this <tt>OpenMBeanParameterInfo</tt> instance.
46      *
47      * @return the description.
48      */

49     public String JavaDoc getDescription() ;
50
51     /**
52      * Returns the name of the parameter
53      * described by this <tt>OpenMBeanParameterInfo</tt> instance.
54      *
55      * @return the name.
56      */

57     public String JavaDoc getName() ;
58
59
60     // Now declares methods that are specific to open MBeans
61
//
62

63     /**
64      * Returns the <i>open type</i> of the values of the parameter
65      * described by this <tt>OpenMBeanParameterInfo</tt> instance.
66      *
67      * @return the open type.
68      */

69     public OpenType JavaDoc getOpenType() ;
70
71     /**
72      * Returns the default value for this parameter, if it has one, or
73      * <tt>null</tt> otherwise.
74      *
75      * @return the default value.
76      */

77     public Object JavaDoc getDefaultValue() ;
78
79     /**
80      * Returns the set of legal values for this parameter, if it has
81      * one, or <tt>null</tt> otherwise.
82      *
83      * @return the set of legal values.
84      */

85     public Set JavaDoc getLegalValues() ;
86
87     /**
88      * Returns the minimal value for this parameter, if it has one, or
89      * <tt>null</tt> otherwise.
90      *
91      * @return the minimum value.
92      */

93     public Comparable JavaDoc getMinValue() ;
94
95     /**
96      * Returns the maximal value for this parameter, if it has one, or
97      * <tt>null</tt> otherwise.
98      *
99      * @return the maximum value.
100      */

101     public Comparable JavaDoc getMaxValue() ;
102
103     /**
104      * Returns <tt>true</tt> if this parameter has a specified default
105      * value, or <tt>false</tt> otherwise.
106      *
107      * @return true if there is a default value.
108      */

109     public boolean hasDefaultValue() ;
110
111     /**
112      * Returns <tt>true</tt> if this parameter has a specified set of
113      * legal values, or <tt>false</tt> otherwise.
114      *
115      * @return true if there is a set of legal values.
116      */

117     public boolean hasLegalValues() ;
118
119     /**
120      * Returns <tt>true</tt> if this parameter has a specified minimal
121      * value, or <tt>false</tt> otherwise.
122      *
123      * @return true if there is a minimum value.
124      */

125     public boolean hasMinValue() ;
126
127     /**
128      * Returns <tt>true</tt> if this parameter has a specified maximal
129      * value, or <tt>false</tt> otherwise.
130      *
131      * @return true if there is a maximum value.
132      */

133     public boolean hasMaxValue() ;
134
135     /**
136      * Tests whether <var>obj</var> is a valid value for the parameter
137      * described by this <code>OpenMBeanParameterInfo</code> instance.
138      *
139      * @param obj the object to be tested.
140      *
141      * @return <code>true</code> if <var>obj</var> is a valid value
142      * for for the parameter described by this
143      * <code>OpenMBeanParameterInfo</code> instance,
144      * <code>false</code> otherwise.
145      */

146     public boolean isValue(Object JavaDoc obj) ;
147
148
149     /**
150      * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanParameterInfo</code> instance for equality.
151      * <p>
152      * Returns <tt>true</tt> if and only if all of the following statements are true:
153      * <ul>
154      * <li><var>obj</var> is non null,</li>
155      * <li><var>obj</var> also implements the <code>OpenMBeanParameterInfo</code> interface,</li>
156      * <li>their names are equal</li>
157      * <li>their open types are equal</li>
158      * <li>their default, min, max and legal values are equal.</li>
159      * </ul>
160      * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
161      * different implementations of the <code>OpenMBeanParameterInfo</code> interface.
162      * <br>&nbsp;
163      * @param obj the object to be compared for equality with this <code>OpenMBeanParameterInfo</code> instance;
164      *
165      * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanParameterInfo</code> instance.
166      */

167     public boolean equals(Object JavaDoc obj);
168
169     /**
170      * Returns the hash code value for this <code>OpenMBeanParameterInfo</code> instance.
171      * <p>
172      * The hash code of an <code>OpenMBeanParameterInfo</code> instance is the sum of the hash codes
173      * of all elements of information used in <code>equals</code> comparisons
174      * (ie: its name, its <i>open type</i>, and its default, min, max and legal values).
175      * <p>
176      * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
177      * for any two <code>OpenMBeanParameterInfo</code> instances <code>t1</code> and <code>t2</code>,
178      * as required by the general contract of the method
179      * {@link Object#hashCode() Object.hashCode()}.
180      * <p>
181      *
182      * @return the hash code value for this <code>OpenMBeanParameterInfo</code> instance
183      */

184     public int hashCode();
185
186     /**
187      * Returns a string representation of this <code>OpenMBeanParameterInfo</code> instance.
188      * <p>
189      * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanParameterInfo</code>),
190      * the string representation of the name and open type of the described parameter,
191      * and the string representation of its default, min, max and legal values.
192      *
193      * @return a string representation of this <code>OpenMBeanParameterInfo</code> instance
194      */

195     public String JavaDoc toString();
196
197 }
198
Popular Tags