author | darcy |
Wed, 23 Oct 2019 13:01:40 -0700 | |
changeset 58766 | 54ffb15c4839 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
24368 | 2 |
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
||
27 |
package javax.management.openmbean; |
|
28 |
||
29 |
||
30 |
// java import |
|
31 |
// |
|
32 |
import java.util.Set; |
|
33 |
import java.lang.Comparable; // to be substituted for jdk1.1.x |
|
34 |
||
35 |
||
36 |
// jmx import |
|
37 |
// |
|
38 |
||
39 |
||
40 |
/** |
|
41 |
* <p>Describes a parameter used in one or more operations or |
|
42 |
* constructors of an open MBean.</p> |
|
43 |
* |
|
44 |
* <p>This interface declares the same methods as the class {@link |
|
45 |
* javax.management.MBeanParameterInfo}. A class implementing this |
|
46 |
* interface (typically {@link OpenMBeanParameterInfoSupport}) should |
|
47 |
* extend {@link javax.management.MBeanParameterInfo}.</p> |
|
48 |
* |
|
49 |
* |
|
50 |
* @since 1.5 |
|
51 |
*/ |
|
52 |
public interface OpenMBeanParameterInfo { |
|
53 |
||
54 |
||
55 |
// Re-declares methods that are in class MBeanParameterInfo of JMX 1.0 |
|
56 |
// (these will be removed when MBeanParameterInfo is made a parent interface of this interface) |
|
57 |
||
58 |
/** |
|
59 |
* Returns a human readable description of the parameter |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
60 |
* described by this {@code OpenMBeanParameterInfo} instance. |
2 | 61 |
* |
62 |
* @return the description. |
|
63 |
*/ |
|
64 |
public String getDescription() ; |
|
65 |
||
66 |
/** |
|
67 |
* Returns the name of the parameter |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
68 |
* described by this {@code OpenMBeanParameterInfo} instance. |
2 | 69 |
* |
70 |
* @return the name. |
|
71 |
*/ |
|
72 |
public String getName() ; |
|
73 |
||
74 |
||
75 |
// Now declares methods that are specific to open MBeans |
|
76 |
// |
|
77 |
||
78 |
/** |
|
79 |
* Returns the <i>open type</i> of the values of the parameter |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
80 |
* described by this {@code OpenMBeanParameterInfo} instance. |
2 | 81 |
* |
82 |
* @return the open type. |
|
83 |
*/ |
|
84 |
public OpenType<?> getOpenType() ; |
|
85 |
||
86 |
/** |
|
87 |
* Returns the default value for this parameter, if it has one, or |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
88 |
* {@code null} otherwise. |
2 | 89 |
* |
90 |
* @return the default value. |
|
91 |
*/ |
|
92 |
public Object getDefaultValue() ; |
|
93 |
||
94 |
/** |
|
95 |
* Returns the set of legal values for this parameter, if it has |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
96 |
* one, or {@code null} otherwise. |
2 | 97 |
* |
98 |
* @return the set of legal values. |
|
99 |
*/ |
|
100 |
public Set<?> getLegalValues() ; |
|
101 |
||
102 |
/** |
|
103 |
* Returns the minimal value for this parameter, if it has one, or |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
104 |
* {@code null} otherwise. |
2 | 105 |
* |
106 |
* @return the minimum value. |
|
107 |
*/ |
|
108 |
public Comparable<?> getMinValue() ; |
|
109 |
||
110 |
/** |
|
111 |
* Returns the maximal value for this parameter, if it has one, or |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
112 |
* {@code null} otherwise. |
2 | 113 |
* |
114 |
* @return the maximum value. |
|
115 |
*/ |
|
116 |
public Comparable<?> getMaxValue() ; |
|
117 |
||
118 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
119 |
* Returns {@code true} if this parameter has a specified default |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
120 |
* value, or {@code false} otherwise. |
2 | 121 |
* |
122 |
* @return true if there is a default value. |
|
123 |
*/ |
|
124 |
public boolean hasDefaultValue() ; |
|
125 |
||
126 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
127 |
* Returns {@code true} if this parameter has a specified set of |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
128 |
* legal values, or {@code false} otherwise. |
2 | 129 |
* |
130 |
* @return true if there is a set of legal values. |
|
131 |
*/ |
|
132 |
public boolean hasLegalValues() ; |
|
133 |
||
134 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
135 |
* Returns {@code true} if this parameter has a specified minimal |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
136 |
* value, or {@code false} otherwise. |
2 | 137 |
* |
138 |
* @return true if there is a minimum value. |
|
139 |
*/ |
|
140 |
public boolean hasMinValue() ; |
|
141 |
||
142 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
143 |
* Returns {@code true} if this parameter has a specified maximal |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
144 |
* value, or {@code false} otherwise. |
2 | 145 |
* |
146 |
* @return true if there is a maximum value. |
|
147 |
*/ |
|
148 |
public boolean hasMaxValue() ; |
|
149 |
||
150 |
/** |
|
151 |
* Tests whether <var>obj</var> is a valid value for the parameter |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
152 |
* described by this {@code OpenMBeanParameterInfo} instance. |
2 | 153 |
* |
154 |
* @param obj the object to be tested. |
|
155 |
* |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
156 |
* @return {@code true} if <var>obj</var> is a valid value |
2 | 157 |
* for the parameter described by this |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
158 |
* {@code OpenMBeanParameterInfo} instance, |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
159 |
* {@code false} otherwise. |
2 | 160 |
*/ |
161 |
public boolean isValue(Object obj) ; |
|
162 |
||
163 |
||
164 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
165 |
* Compares the specified <var>obj</var> parameter with this {@code OpenMBeanParameterInfo} instance for equality. |
2 | 166 |
* <p> |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
167 |
* Returns {@code true} if and only if all of the following statements are true: |
2 | 168 |
* <ul> |
169 |
* <li><var>obj</var> is non null,</li> |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
170 |
* <li><var>obj</var> also implements the {@code OpenMBeanParameterInfo} interface,</li> |
2 | 171 |
* <li>their names are equal</li> |
172 |
* <li>their open types are equal</li> |
|
173 |
* <li>their default, min, max and legal values are equal.</li> |
|
174 |
* </ul> |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
175 |
* This ensures that this {@code equals} method works properly for <var>obj</var> parameters which are |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
176 |
* different implementations of the {@code OpenMBeanParameterInfo} interface. |
2 | 177 |
* <br> |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
178 |
* @param obj the object to be compared for equality with this {@code OpenMBeanParameterInfo} instance; |
2 | 179 |
* |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
180 |
* @return {@code true} if the specified object is equal to this {@code OpenMBeanParameterInfo} instance. |
2 | 181 |
*/ |
182 |
public boolean equals(Object obj); |
|
183 |
||
184 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
185 |
* Returns the hash code value for this {@code OpenMBeanParameterInfo} instance. |
2 | 186 |
* <p> |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
187 |
* The hash code of an {@code OpenMBeanParameterInfo} instance is the sum of the hash codes |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
188 |
* of all elements of information used in {@code equals} comparisons |
2 | 189 |
* (ie: its name, its <i>open type</i>, and its default, min, max and legal values). |
190 |
* <p> |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
191 |
* This ensures that {@code t1.equals(t2)} implies that {@code t1.hashCode()==t2.hashCode()} |
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
192 |
* for any two {@code OpenMBeanParameterInfo} instances {@code t1} and {@code t2}, |
2 | 193 |
* as required by the general contract of the method |
194 |
* {@link Object#hashCode() Object.hashCode()}. |
|
195 |
* |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
196 |
* @return the hash code value for this {@code OpenMBeanParameterInfo} instance |
2 | 197 |
*/ |
198 |
public int hashCode(); |
|
199 |
||
200 |
/** |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
201 |
* Returns a string representation of this {@code OpenMBeanParameterInfo} instance. |
2 | 202 |
* <p> |
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
203 |
* The string representation consists of the name of this class (ie {@code javax.management.openmbean.OpenMBeanParameterInfo}), |
2 | 204 |
* the string representation of the name and open type of the described parameter, |
205 |
* and the string representation of its default, min, max and legal values. |
|
206 |
* |
|
32034
05676cfd40b5
8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents:
25859
diff
changeset
|
207 |
* @return a string representation of this {@code OpenMBeanParameterInfo} instance |
2 | 208 |
*/ |
209 |
public String toString(); |
|
210 |
||
211 |
} |