OpenMBeanParameterInfo.java 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* OpenMBeanParameterInfo.java -- Open typed info about a parameter.
  2. Copyright (C) 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package javax.management.openmbean;
  32. import java.util.Set;
  33. /**
  34. * Describes the parameters of a constructor or operation associated
  35. * with an open management bean. This interface includes those methods
  36. * specified by {@link javax.management.MBeanParameterInfo}, so
  37. * implementations should extend this class.
  38. *
  39. * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
  40. * @since 1.5
  41. */
  42. public interface OpenMBeanParameterInfo
  43. {
  44. /**
  45. * Compares this parameter with the supplied object. This returns
  46. * true iff the object is an instance of {@link OpenMBeanParameterInfo}
  47. * with an equal name and open type and the same default, minimum,
  48. * maximum and legal values.
  49. *
  50. * @param obj the object to compare.
  51. * @return true if the object is a {@link OpenMBeanParameterInfo}
  52. * instance,
  53. * <code>name.equals(object.getName())</code>,
  54. * <code>openType.equals(object.getOpenType())</code>,
  55. * <code>defaultValue.equals(object.getDefaultValue())</code>,
  56. * <code>minValue.equals(object.getMinValue())</code>,
  57. * <code>maxValue.equals(object.getMaxValue())</code>,
  58. * and <code>legalValues.equals(object.getLegalValues())</code>.
  59. */
  60. boolean equals(Object obj);
  61. /**
  62. * Returns the default value of this parameter, or <code>null</code>
  63. * if there is no default value.
  64. *
  65. * @return the default value of the parameter, or <code>null</code>
  66. * if there is no default.
  67. */
  68. Object getDefaultValue();
  69. /**
  70. * Returns a description of this parameter.
  71. *
  72. * @return a human-readable description.
  73. */
  74. String getDescription();
  75. /**
  76. * Returns a {@link java.util.Set} enumerating the legal values
  77. * of this parameter, or <code>null</code> if no such limited
  78. * set exists for this parameter.
  79. *
  80. * @return a set of legal values, or <code>null</code> if no such
  81. * set exists.
  82. */
  83. Set<?> getLegalValues();
  84. /**
  85. * Returns the maximum value of this parameter, or <code>null</code>
  86. * if there is no maximum.
  87. *
  88. * @return the maximum value, or <code>null</code> if none exists.
  89. */
  90. Comparable<?> getMaxValue();
  91. /**
  92. * Returns the minimum value of this parameter, or <code>null</code>
  93. * if there is no minimum.
  94. *
  95. * @return the minimum value, or <code>null</code> if none exists.
  96. */
  97. Comparable<?> getMinValue();
  98. /**
  99. * Returns the name of this parameter.
  100. *
  101. * @return the name of the parameter.
  102. */
  103. String getName();
  104. /**
  105. * Returns the open type instance which represents the type of this
  106. * parameter.
  107. *
  108. * @return the open type of this parameter.
  109. */
  110. OpenType<?> getOpenType();
  111. /**
  112. * Returns true if this parameter has a default value.
  113. *
  114. * @return true if this parameter has a default.
  115. */
  116. boolean hasDefaultValue();
  117. /**
  118. * Returns the hashcode of the parameter information as the sum of
  119. * the hashcodes of the name, open type, default value, maximum
  120. * value, minimum value and the set of legal values.
  121. *
  122. * @return the hashcode of the parameter information.
  123. */
  124. int hashCode();
  125. /**
  126. * Returns true if there is a set of legal values for this
  127. * parameter.
  128. *
  129. * @return true if a set of legal values exists for this
  130. * parameter.
  131. */
  132. boolean hasLegalValues();
  133. /**
  134. * Returns true if there is a maximum value for this parameter.
  135. *
  136. * @return true if a maximum value exists for this parameter.
  137. */
  138. boolean hasMaxValue();
  139. /**
  140. * Returns true if there is a minimum value for this parameter.
  141. *
  142. * @return true if a minimum value exists for this parameter.
  143. */
  144. boolean hasMinValue();
  145. /**
  146. * Returns true if the specified object is a valid value for
  147. * this parameter.
  148. *
  149. * @param obj the object to test.
  150. * @return true if <code>obj</code> is a valid value for this
  151. * parameter.
  152. */
  153. boolean isValue(Object obj);
  154. /**
  155. * Returns a textual representation of this instance. This
  156. * is constructed using the class name
  157. * (<code>javax.management.openmbean.OpenMBeanParameterInfo</code>)
  158. * along with the name, open type, default, minimum, maximum
  159. * and legal values of the parameter.
  160. *
  161. * @return a @link{java.lang.String} instance representing
  162. * the instance in textual form.
  163. */
  164. String toString();
  165. }