1. /*
  2. * @(#)OpenMBeanParameterInfoSupport.java 3.28 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. import java.io.Serializable;
  11. import java.util.Set;
  12. import java.util.HashSet;
  13. import java.util.Collections;
  14. import java.lang.Comparable; // to be substituted for jdk1.1.x
  15. // jmx import
  16. //
  17. import javax.management.MBeanParameterInfo;
  18. /**
  19. * Describes a parameter used in one or more operations or constructors of an open MBean.
  20. *
  21. * @version 3.28 03/12/19
  22. * @author Sun Microsystems, Inc.
  23. *
  24. * @since 1.5
  25. * @since.unbundled JMX 1.1
  26. */
  27. public class OpenMBeanParameterInfoSupport
  28. extends MBeanParameterInfo
  29. implements OpenMBeanParameterInfo, Serializable {
  30. /* Serial version */
  31. static final long serialVersionUID = -7235016873758443122L;
  32. /**
  33. * @serial The open mbean parameter's <i>open type</i>
  34. */
  35. private OpenType openType;
  36. /**
  37. * @serial The open mbean parameter's default value
  38. */
  39. private Object defaultValue = null;
  40. /**
  41. * @serial The open mbean parameter's legal values. This {@link Set} is unmodifiable
  42. */
  43. private Set legalValues = null; // to be constructed unmodifiable
  44. /**
  45. * @serial The open mbean parameter's min value
  46. */
  47. private Comparable minValue = null;
  48. /**
  49. * @serial The open mbean parameter's max value
  50. */
  51. private Comparable maxValue = null;
  52. private transient Integer myHashCode = null; // As this instance is immutable, these two values
  53. private transient String myToString = null; // need only be calculated once.
  54. /**
  55. * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
  56. * used in one or more operations or constructors of a class of open MBeans,
  57. * with the specified <var>name</var>, <var>openType</var> and <var>description</var>.
  58. *
  59. * @param name cannot be a null or empty string.
  60. *
  61. * @param description cannot be a null or empty string.
  62. *
  63. * @param openType cannot be null.
  64. *
  65. * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
  66. * or <var>openType</var> is null.
  67. */
  68. public OpenMBeanParameterInfoSupport(String name,
  69. String description,
  70. OpenType openType) {
  71. // Construct parent's state
  72. //
  73. super(name, ( (openType==null) ? null : openType.getClassName() ), description);
  74. // check parameters that should not be null or empty (unfortunately it is not done in superclass :-( ! )
  75. //
  76. if ( (name == null) || (name.trim().equals("")) ) {
  77. throw new IllegalArgumentException("Argument name cannot be null or empty.");
  78. }
  79. if ( (description == null) || (description.trim().equals("")) ) {
  80. throw new IllegalArgumentException("Argument description cannot be null or empty.");
  81. }
  82. if (openType == null) {
  83. throw new IllegalArgumentException("Argument openType cannot be null.");
  84. }
  85. // Initialize this instance's specific state
  86. //
  87. this.openType = openType;
  88. }
  89. /**
  90. * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
  91. * used in one or more operations or constructors of a class of open MBeans,
  92. * with the specified <var>name</var>, <var>openType</var>, <var>description</var> and <var>defaultValue</var>.
  93. *
  94. * @param name cannot be a null or empty string.
  95. *
  96. * @param description cannot be a null or empty string.
  97. *
  98. * @param openType cannot be null.
  99. *
  100. * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
  101. * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>
  102. * can be null, in which case it means that no default value is set.
  103. *
  104. * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
  105. * or <var>openType</var> is null.
  106. *
  107. * @throws OpenDataException if <var>defaultValue</var> is not a valid value for the specified <var>openType</var>,
  108. * or <var>defaultValue</var> is non null and
  109. * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>.
  110. */
  111. public OpenMBeanParameterInfoSupport(String name,
  112. String description,
  113. OpenType openType,
  114. Object defaultValue) throws OpenDataException {
  115. // First check and construct the part regarding name, openType and description
  116. //
  117. this(name, description, openType);
  118. // Check and initialize defaultValue
  119. //
  120. if (defaultValue != null) {
  121. // Default value not supported for ArrayType and TabularType
  122. if ( (openType.isArray()) || (openType instanceof TabularType) ) {
  123. throw new OpenDataException("Default value not supported for ArrayType and TabularType.");
  124. }
  125. // Check defaultValue's class
  126. if ( ! openType.isValue(defaultValue) ) {
  127. throw new OpenDataException("Argument defaultValue's class [\""+ defaultValue.getClass().getName() +
  128. "\"] does not match the one defined in openType[\""+ openType.getClassName() +"\"].");
  129. }
  130. // Then initializes defaultValue:
  131. // no need to clone it: apart from arrays and TabularData, basic data types are immutable
  132. this.defaultValue = defaultValue;
  133. }
  134. }
  135. /**
  136. * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
  137. * used in one or more operations or constructors of a class of open MBeans,
  138. * with the specified <var>name</var>, <var>openType</var>, <var>description</var>,
  139. * <var>defaultValue</var> and <var>legalValues</var>.
  140. *
  141. * The contents of <var>legalValues</var> are internally dumped into an unmodifiable <tt>Set</tt>,
  142. * so subsequent modifications of the array referenced by <var>legalValues</var> have no impact on
  143. * this <tt>OpenMBeanParameterInfoSupport</tt> instance.
  144. *
  145. * @param name cannot be a null or empty string.
  146. *
  147. * @param description cannot be a null or empty string.
  148. *
  149. * @param openType cannot be null.
  150. *
  151. * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
  152. * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>
  153. * can be null, in which case it means that no default value is set.
  154. *
  155. * @param legalValues each contained value must be valid for the <var>openType</var> specified for this parameter;
  156. * legal values not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>
  157. * can be null or empty.
  158. *
  159. * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
  160. * or <var>openType</var> is null.
  161. *
  162. * @throws OpenDataException if <var>defaultValue</var> is not a valid value for the specified <var>openType</var>,
  163. * or one value in <var>legalValues</var> is not valid for the specified <var>openType</var>,
  164. * or <var>defaultValue</var> is non null and
  165. * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
  166. * or <var>legalValues</var> is non null and non empty and
  167. * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
  168. * or <var>legalValues</var> is non null and non empty and
  169. * <var>defaultValue</var> is not contained in <var>legalValues</var>.
  170. */
  171. public OpenMBeanParameterInfoSupport(String name,
  172. String description,
  173. OpenType openType,
  174. Object defaultValue,
  175. Object[] legalValues) throws OpenDataException {
  176. // First check and construct the part regarding name, openType, description and defaultValue
  177. //
  178. this(name, description, openType, defaultValue);
  179. // Check and initialize legalValues
  180. //
  181. if ( (legalValues != null) && (legalValues.length > 0) ) {
  182. // legalValues not supported for TabularType and arrays
  183. if ( (openType instanceof TabularType) || (openType.isArray()) ) {
  184. throw new OpenDataException("Legal values not supported for TabularType and arrays");
  185. }
  186. // Check legalValues are valid with openType
  187. for (int i = 0; i < legalValues.length; i++ ) {
  188. if ( ! openType.isValue(legalValues[i]) ) {
  189. throw new OpenDataException("Element legalValues["+ i +"]="+ legalValues[i] +
  190. " is not a valid value for the specified openType ["+ openType.toString() +"].");
  191. }
  192. }
  193. // dump the legalValues array content into a Set: ensures uniqueness of elements
  194. // (and we could not keep the array reference as array content could be modified by the caller)
  195. Set tmpSet = new HashSet(legalValues.length+1, 1);
  196. for (int i = 0; i < legalValues.length; i++ ) {
  197. tmpSet.add(legalValues[i]);
  198. }
  199. // initializes legalValues as an unmodifiable Set
  200. this.legalValues = Collections.unmodifiableSet(tmpSet);
  201. }
  202. // Check that defaultValue is a legal value
  203. //
  204. if ( (this.hasDefaultValue()) && (this.hasLegalValues()) ) {
  205. if ( ! this.legalValues.contains(defaultValue) ) {
  206. throw new OpenDataException("defaultValue is not contained in legalValues");
  207. }
  208. }
  209. }
  210. /**
  211. * Constructs an <tt>OpenMBeanParameterInfoSupport</tt> instance, which describes the parameter
  212. * used in one or more operations or constructors of a class of open MBeans,
  213. * with the specified <var>name</var>, <var>openType</var>, <var>description</var>,
  214. * <var>defaultValue</var>, <var>minValue</var> and <var>maxValue</var>.
  215. *
  216. * It is possible to specify minimal and maximal values only for an open type
  217. * whose values are <tt>Comparable</tt>.
  218. *
  219. * @param name cannot be a null or empty string.
  220. *
  221. * @param description cannot be a null or empty string.
  222. *
  223. * @param openType cannot be null.
  224. *
  225. * @param defaultValue must be a valid value for the <var>openType</var> specified for this parameter;
  226. * default value not supported for <tt>ArrayType</tt> and <tt>TabularType</tt>
  227. * can be null, in which case it means that no default value is set.
  228. *
  229. * @param minValue must be valid for the <var>openType</var> specified for this parameter;
  230. * can be null, in which case it means that no minimal value is set.
  231. *
  232. * @param maxValue must be valid for the <var>openType</var> specified for this parameter;
  233. * can be null, in which case it means that no maximal value is set.
  234. *
  235. * @throws IllegalArgumentException if <var>name</var> or <var>description</var> are null or empty string,
  236. * or <var>openType</var> is null.
  237. *
  238. * @throws OpenDataException if <var>defaultValue</var>, <var>minValue</var> or <var>maxValue</var>
  239. * is not a valid value for the specified <var>openType</var>,
  240. * or <var>defaultValue</var> is non null and
  241. * <var>openType</var> is an <tt>ArrayType</tt> or a <tt>TabularType</tt>,
  242. * or both <var>minValue</var> and <var>maxValue</var> are non-null and
  243. * <tt>minValue.compareTo(maxValue) > 0</tt> is <tt>true</tt>,
  244. * or both <var>defaultValue</var> and <var>minValue</var> are non-null and
  245. * <tt>minValue.compareTo(defaultValue) > 0</tt> is <tt>true</tt>,
  246. * or both <var>defaultValue</var> and <var>maxValue</var> are non-null and
  247. * <tt>defaultValue.compareTo(maxValue) > 0</tt> is <tt>true</tt>.
  248. */
  249. public OpenMBeanParameterInfoSupport(String name,
  250. String description,
  251. OpenType openType,
  252. Object defaultValue,
  253. Comparable minValue,
  254. Comparable maxValue) throws OpenDataException {
  255. // First check and construct the part regarding name, openType, description and defaultValue
  256. //
  257. this(name, description, openType, defaultValue);
  258. // Check and initialize minValue
  259. //(note: no need to worry about Composite, Tabular and arrays as they are not Comparable)
  260. //
  261. if (minValue != null) {
  262. if ( ! openType.isValue(minValue) ) {
  263. throw new OpenDataException("Argument minValue's class [\""+ minValue.getClass().getName() +
  264. "\"] does not match openType's definition [\""+ openType.getClassName() +"\"].");
  265. }
  266. // then initializes minValue
  267. this.minValue = minValue;
  268. }
  269. // Check and initialize maxValue
  270. //(note: no need to worry about Composite, Tabular and arrays as they are not Comparable)
  271. //
  272. if (maxValue != null) {
  273. if ( ! openType.isValue(maxValue) ) {
  274. throw new OpenDataException("Argument maxValue's class [\""+ maxValue.getClass().getName() +
  275. "\"] does not match openType's definition [\""+ openType.getClassName() +"\"].");
  276. }
  277. // then initializes maxValue
  278. this.maxValue = maxValue;
  279. }
  280. // Check that, if both specified, minValue <= maxValue
  281. //
  282. if (hasMinValue() && hasMaxValue()) {
  283. if (minValue.compareTo(maxValue) > 0) {
  284. throw new OpenDataException("minValue cannot be greater than maxValue.");
  285. }
  286. }
  287. // Check that minValue <= defaultValue <= maxValue
  288. //
  289. if ( (this.hasDefaultValue()) && (this.hasMinValue()) ) {
  290. if (minValue.compareTo((Comparable)defaultValue) > 0) {
  291. throw new OpenDataException("minValue cannot be greater than defaultValue.");
  292. }
  293. }
  294. if ( (this.hasDefaultValue()) && (this.hasMaxValue()) ) {
  295. if (((Comparable)defaultValue).compareTo(maxValue) > 0) {
  296. throw new OpenDataException("defaultValue cannot be greater than maxValue.");
  297. }
  298. }
  299. }
  300. /**
  301. * Returns the open type for the values of the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance.
  302. */
  303. public OpenType getOpenType() {
  304. return openType;
  305. }
  306. /**
  307. * Returns the default value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
  308. * if specified, or <tt>null</tt> otherwise.
  309. */
  310. public Object getDefaultValue() {
  311. // Special case for ArrayType and TabularType
  312. // [JF] TODO: clone it so that it cannot be altered,
  313. // [JF] TODO: if we decide to support defaultValue as an array itself.
  314. // [JF] As of today (oct 2000) it is not supported so defaultValue is null for arrays. Nothing to do.
  315. return defaultValue;
  316. }
  317. /**
  318. * Returns an unmodifiable Set of legal values for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
  319. * if specified, or <tt>null</tt> otherwise.
  320. */
  321. public Set getLegalValues() {
  322. // Special case for ArrayType and TabularType
  323. // [JF] TODO: clone values so that they cannot be altered,
  324. // [JF] TODO: if we decide to support LegalValues as an array itself.
  325. // [JF] As of today (oct 2000) it is not supported so legalValues is null for arrays. Nothing to do.
  326. // Returns our legalValues Set (set was constructed unmodifiable)
  327. return (legalValues);
  328. }
  329. /**
  330. * Returns the minimal value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
  331. * if specified, or <tt>null</tt> otherwise.
  332. */
  333. public Comparable getMinValue() {
  334. // Note: only comparable values have a minValue, so that's not the case of arrays and tabulars (always null).
  335. return minValue;
  336. }
  337. /**
  338. * Returns the maximal value for the parameter described by this <tt>OpenMBeanParameterInfoSupport</tt> instance,
  339. * if specified, or <tt>null</tt> otherwise.
  340. */
  341. public Comparable getMaxValue() {
  342. // Note: only comparable values have a maxValue, so that's not the case of arrays and tabulars (always null).
  343. return maxValue;
  344. }
  345. /**
  346. * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null default value
  347. * for the described parameter, <tt>false</tt> otherwise.
  348. */
  349. public boolean hasDefaultValue() {
  350. return (defaultValue != null);
  351. }
  352. /**
  353. * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null set of legal values
  354. * for the described parameter, <tt>false</tt> otherwise.
  355. */
  356. public boolean hasLegalValues() {
  357. return (legalValues != null);
  358. }
  359. /**
  360. * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null minimal value
  361. * for the described parameter, <tt>false</tt> otherwise.
  362. */
  363. public boolean hasMinValue() {
  364. return (minValue != null);
  365. }
  366. /**
  367. * Returns <tt>true</tt> if this <tt>OpenMBeanParameterInfoSupport</tt> instance specifies a non-null maximal value
  368. * for the described parameter, <tt>false</tt> otherwise.
  369. */
  370. public boolean hasMaxValue() {
  371. return (maxValue != null);
  372. }
  373. /**
  374. * Tests whether <var>obj</var> is a valid value for the parameter
  375. * described by this <code>OpenMBeanParameterInfo</code> instance.
  376. *
  377. * @param obj the object to be tested.
  378. *
  379. * @return <code>true</code> if <var>obj</var> is a valid value
  380. * for the parameter described by this
  381. * <code>OpenMBeanParameterInfo</code> instance,
  382. * <code>false</code> otherwise.
  383. */
  384. public boolean isValue(Object obj) {
  385. boolean result;
  386. if ( hasDefaultValue() && obj == null ) {
  387. result = true;
  388. }
  389. else if ( ! openType.isValue(obj) ) {
  390. result = false;
  391. }
  392. else if ( hasLegalValues() && ! legalValues.contains(obj) ) {
  393. result = false;
  394. }
  395. else if ( hasMinValue() && (minValue.compareTo(obj)>0) ) {
  396. result = false;
  397. }
  398. else if ( hasMaxValue() && (maxValue.compareTo(obj)<0) ) {
  399. result = false;
  400. }
  401. else {
  402. result = true;
  403. }
  404. return result;
  405. }
  406. /* *** Commodity methods from java.lang.Object *** */
  407. /**
  408. * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanParameterInfoSupport</code> instance for equality.
  409. * <p>
  410. * Returns <tt>true</tt> if and only if all of the following statements are true:
  411. * <ul>
  412. * <li><var>obj</var> is non null,</li>
  413. * <li><var>obj</var> also implements the <code>OpenMBeanParameterInfo</code> interface,</li>
  414. * <li>their names are equal</li>
  415. * <li>their open types are equal</li>
  416. * <li>their default, min, max and legal values are equal.</li>
  417. * </ul>
  418. * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
  419. * different implementations of the <code>OpenMBeanParameterInfo</code> interface.
  420. * <br> 
  421. * @param obj the object to be compared for equality with this <code>OpenMBeanParameterInfoSupport</code> instance;
  422. *
  423. * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanParameterInfoSupport</code> instance.
  424. */
  425. public boolean equals(Object obj) {
  426. // if obj is null, return false
  427. //
  428. if (obj == null) {
  429. return false;
  430. }
  431. // if obj is not a OpenMBeanParameterInfo, return false
  432. //
  433. OpenMBeanParameterInfo other;
  434. try {
  435. other = (OpenMBeanParameterInfo) obj;
  436. } catch (ClassCastException e) {
  437. return false;
  438. }
  439. // Now, really test for equality between this OpenMBeanParameterInfo implementation and the other:
  440. //
  441. // their Name should be equal
  442. if ( ! this.getName().equals(other.getName()) ) {
  443. return false;
  444. }
  445. // their OpenType should be equal
  446. if ( ! this.getOpenType().equals(other.getOpenType()) ) {
  447. return false;
  448. }
  449. // their DefaultValue should be equal
  450. if (this.hasDefaultValue()) {
  451. if ( ! this.defaultValue.equals(other.getDefaultValue()) ) {
  452. return false;
  453. }
  454. } else {
  455. if (other.hasDefaultValue()) {
  456. return false;
  457. }
  458. }
  459. // their MinValue should be equal
  460. if (this.hasMinValue()) {
  461. if ( ! this.minValue.equals(other.getMinValue()) ) {
  462. return false;
  463. }
  464. } else {
  465. if (other.hasMinValue()) {
  466. return false;
  467. }
  468. }
  469. // their MaxValue should be equal
  470. if (this.hasMaxValue()) {
  471. if ( ! this.maxValue.equals(other.getMaxValue()) ) {
  472. return false;
  473. }
  474. } else {
  475. if (other.hasMaxValue()) {
  476. return false;
  477. }
  478. }
  479. // their LegalValues should be equal
  480. if (this.hasLegalValues()) {
  481. if ( ! this.legalValues.equals(other.getLegalValues()) ) {
  482. return false;
  483. }
  484. } else {
  485. if (other.hasLegalValues()) {
  486. return false;
  487. }
  488. }
  489. // All tests for equality were successfull
  490. //
  491. return true;
  492. }
  493. /**
  494. * Returns the hash code value for this <code>OpenMBeanParameterInfoSupport</code> instance.
  495. * <p>
  496. * The hash code of an <code>OpenMBeanParameterInfoSupport</code> instance is the sum of the hash codes
  497. * of all elements of information used in <code>equals</code> comparisons
  498. * (ie: its name, its <i>open type</i>, and its default, min, max and legal values).
  499. * <p>
  500. * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
  501. * for any two <code>OpenMBeanParameterInfoSupport</code> instances <code>t1</code> and <code>t2</code>,
  502. * as required by the general contract of the method
  503. * {@link Object#hashCode() Object.hashCode()}.
  504. * <p>
  505. * However, note that another instance of a class implementing the <code>OpenMBeanParameterInfo</code> interface
  506. * may be equal to this <code>OpenMBeanParameterInfoSupport</code> instance as defined by {@link #equals(java.lang.Object)},
  507. * but may have a different hash code if it is calculated differently.
  508. * <p>
  509. * As <code>OpenMBeanParameterInfoSupport</code> instances are immutable, the hash code for this instance is calculated once,
  510. * on the first call to <code>hashCode</code>, and then the same value is returned for subsequent calls.
  511. *
  512. * @return the hash code value for this <code>OpenMBeanParameterInfoSupport</code> instance
  513. */
  514. public int hashCode() {
  515. // Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
  516. //
  517. if (myHashCode == null) {
  518. int value = 0;
  519. value += this.getName().hashCode();
  520. value += this.openType.hashCode();
  521. if (this.hasDefaultValue()) {
  522. value += this.defaultValue.hashCode();
  523. }
  524. if (this.hasMinValue()) {
  525. value += this.minValue.hashCode();
  526. }
  527. if (this.hasMaxValue()) {
  528. value += this.maxValue.hashCode();
  529. }
  530. if (this.hasLegalValues()) {
  531. value += this.legalValues.hashCode();
  532. }
  533. myHashCode = new Integer(value);
  534. }
  535. // return always the same hash code for this instance (immutable)
  536. //
  537. return myHashCode.intValue();
  538. }
  539. /**
  540. * Returns a string representation of this <code>OpenMBeanParameterInfoSupport</code> instance.
  541. * <p>
  542. * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanParameterInfoSupport</code>),
  543. * the string representation of the name and open type of the described parameter,
  544. * and the string representation of its default, min, max and legal values.
  545. * <p>
  546. * As <code>OpenMBeanParameterInfoSupport</code> instances are immutable, the string representation for this instance is calculated once,
  547. * on the first call to <code>toString</code>, and then the same value is returned for subsequent calls.
  548. *
  549. * @return a string representation of this <code>OpenMBeanParameterInfoSupport</code> instance
  550. */
  551. public String toString() {
  552. // Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
  553. //
  554. if (myToString == null) {
  555. myToString = new StringBuffer()
  556. .append(this.getClass().getName())
  557. .append("(name=")
  558. .append(this.getName())
  559. .append(",openType=")
  560. .append(this.openType.toString())
  561. .append(",default=")
  562. .append(String.valueOf(this.defaultValue))
  563. .append(",min=")
  564. .append(String.valueOf(this.minValue))
  565. .append(",max=")
  566. .append(String.valueOf(this.maxValue))
  567. .append(",legals=")
  568. .append(String.valueOf(this.legalValues))
  569. .append(")")
  570. .toString();
  571. }
  572. // return always the same string representation for this instance (immutable)
  573. //
  574. return myToString;
  575. }
  576. }