1. /*
  2. * @(#)OpenMBeanAttributeInfo.java 3.20 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. package javax.management.openmbean;
  8. // java import
  9. //
  10. // jmx import
  11. //
  12. /**
  13. * <p>Describes an attribute of an open MBean.</p>
  14. *
  15. * <p>This interface declares the same methods as the class {@link
  16. * javax.management.MBeanAttributeInfo}. A class implementing this
  17. * interface (typically {@link OpenMBeanAttributeInfoSupport}) should
  18. * extend {@link javax.management.MBeanAttributeInfo}.</p>
  19. *
  20. * @version 3.20 03/12/19
  21. * @author Sun Microsystems, Inc.
  22. *
  23. * @since 1.5
  24. * @since.unbundled JMX 1.1
  25. */
  26. public interface OpenMBeanAttributeInfo extends OpenMBeanParameterInfo {
  27. // Re-declares the methods that are in class MBeanAttributeInfo of JMX 1.0
  28. // (these will be removed when MBeanAttributeInfo is made a parent interface of this interface)
  29. /**
  30. * Returns <tt>true</tt> if the attribute described by this <tt>OpenMBeanAttributeInfo</tt> instance is readable,
  31. * <tt>false</tt> otherwise.
  32. *
  33. * @return true if the attribute is readable.
  34. */
  35. public boolean isReadable() ;
  36. /**
  37. * Returns <tt>true</tt> if the attribute described by this <tt>OpenMBeanAttributeInfo</tt> instance is writable,
  38. * <tt>false</tt> otherwise.
  39. *
  40. * @return true if the attribute is writable.
  41. */
  42. public boolean isWritable() ;
  43. /**
  44. * Returns <tt>true</tt> if the attribute described by this <tt>OpenMBeanAttributeInfo</tt> instance
  45. * is accessed through a <tt>is<i>XXX</i></tt> getter (applies only to <tt>boolean</tt> and <tt>Boolean</tt> values),
  46. * <tt>false</tt> otherwise.
  47. *
  48. * @return true if the attribute is accessed through <tt>is<i>XXX</i></tt>.
  49. */
  50. public boolean isIs() ;
  51. // commodity methods
  52. //
  53. /**
  54. * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanAttributeInfo</code> instance for equality.
  55. * <p>
  56. * Returns <tt>true</tt> if and only if all of the following statements are true:
  57. * <ul>
  58. * <li><var>obj</var> is non null,</li>
  59. * <li><var>obj</var> also implements the <code>OpenMBeanAttributeInfo</code> interface,</li>
  60. * <li>their names are equal</li>
  61. * <li>their open types are equal</li>
  62. * <li>their access properties (isReadable, isWritable and isIs) are equal</li>
  63. * <li>their default, min, max and legal values are equal.</li>
  64. * </ul>
  65. * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
  66. * different implementations of the <code>OpenMBeanAttributeInfo</code> interface.
  67. * <br> 
  68. * @param obj the object to be compared for equality with this <code>OpenMBeanAttributeInfo</code> instance;
  69. *
  70. * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanAttributeInfo</code> instance.
  71. */
  72. public boolean equals(Object obj);
  73. /**
  74. * Returns the hash code value for this <code>OpenMBeanAttributeInfo</code> instance.
  75. * <p>
  76. * The hash code of an <code>OpenMBeanAttributeInfo</code> instance is the sum of the hash codes
  77. * of all elements of information used in <code>equals</code> comparisons
  78. * (ie: its name, its <i>open type</i>, and its default, min, max and legal values).
  79. * <p>
  80. * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
  81. * for any two <code>OpenMBeanAttributeInfo</code> instances <code>t1</code> and <code>t2</code>,
  82. * as required by the general contract of the method
  83. * {@link Object#hashCode() Object.hashCode()}.
  84. * <p>
  85. *
  86. * @return the hash code value for this <code>OpenMBeanAttributeInfo</code> instance
  87. */
  88. public int hashCode();
  89. /**
  90. * Returns a string representation of this <code>OpenMBeanAttributeInfo</code> instance.
  91. * <p>
  92. * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanAttributeInfo</code>),
  93. * the string representation of the name and open type of the described attribute,
  94. * and the string representation of its default, min, max and legal values.
  95. *
  96. * @return a string representation of this <code>OpenMBeanAttributeInfo</code> instance
  97. */
  98. public String toString();
  99. // methods specific to open MBeans are inherited from
  100. // OpenMBeanParameterInfo
  101. //
  102. }