summaryrefslogtreecommitdiff
path: root/javax/management/MBeanFeatureInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/management/MBeanFeatureInfo.java')
-rw-r--r--javax/management/MBeanFeatureInfo.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/javax/management/MBeanFeatureInfo.java b/javax/management/MBeanFeatureInfo.java
index 79acc7b39..4f0243e18 100644
--- a/javax/management/MBeanFeatureInfo.java
+++ b/javax/management/MBeanFeatureInfo.java
@@ -77,6 +77,11 @@ public class MBeanFeatureInfo
protected String name;
/**
+ * The <code>toString()</code> result of this instance.
+ */
+ protected transient String string;
+
+ /**
* Constructs a new {@link MBeanFeatureInfo} with the specified
* name and description.
*
@@ -152,4 +157,30 @@ public class MBeanFeatureInfo
+ (description == null ? -1 : description.hashCode());
}
+ /**
+ * <p>
+ * Returns a textual representation of this instance. This
+ * is constructed using the class name
+ * (<code>javax.management.MBeanFeatureInfo</code>) and
+ * the name and description of the feature.
+ * </p>
+ * <p>
+ * As instances of this class are immutable, the return value
+ * is computed just once for each instance and reused
+ * throughout its life.
+ * </p>
+ *
+ * @return a @link{java.lang.String} instance representing
+ * the instance in textual form.
+ */
+ public String toString()
+ {
+ if (string == null)
+ string = getClass().getName()
+ + "[name=" + name
+ + ",desc=" + description
+ + "]";
+ return string;
+ }
+
}