src/java.management/share/classes/javax/management/relation/RoleInfo.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 439      * @return true if lower than or equal to maximum degree, false otherwise.
 440      */
 441     public boolean checkMaxDegree(int value) {
 442         if (value >= ROLE_CARDINALITY_INFINITY &&
 443             (maxDegree == ROLE_CARDINALITY_INFINITY ||
 444              (value != ROLE_CARDINALITY_INFINITY &&
 445               value <= maxDegree))) {
 446             return true;
 447         } else {
 448             return false;
 449         }
 450     }
 451 
 452     /**
 453      * Returns a string describing the role info.
 454      *
 455      * @return a description of the role info.
 456      */
 457     public String toString() {
 458         StringBuilder result = new StringBuilder();
 459         result.append("role info name: " + name);
 460         result.append("; isReadable: " + isReadable);
 461         result.append("; isWritable: " + isWritable);
 462         result.append("; description: " + description);
 463         result.append("; minimum degree: " + minDegree);
 464         result.append("; maximum degree: " + maxDegree);
 465         result.append("; MBean class: " + referencedMBeanClassName);
 466         return result.toString();
 467     }
 468 
 469     //
 470     // Misc
 471     //
 472 
 473     // Initialization
 474     private void init(String roleName,
 475                       String mbeanClassName,
 476                       boolean read,
 477                       boolean write,
 478                       int min,
 479                       int max,
 480                       String descr)
 481             throws IllegalArgumentException,
 482                    InvalidRoleInfoException {
 483 
 484         if (roleName == null ||
 485             mbeanClassName == null) {




 439      * @return true if lower than or equal to maximum degree, false otherwise.
 440      */
 441     public boolean checkMaxDegree(int value) {
 442         if (value >= ROLE_CARDINALITY_INFINITY &&
 443             (maxDegree == ROLE_CARDINALITY_INFINITY ||
 444              (value != ROLE_CARDINALITY_INFINITY &&
 445               value <= maxDegree))) {
 446             return true;
 447         } else {
 448             return false;
 449         }
 450     }
 451 
 452     /**
 453      * Returns a string describing the role info.
 454      *
 455      * @return a description of the role info.
 456      */
 457     public String toString() {
 458         StringBuilder result = new StringBuilder();
 459         result.append("role info name: ").append(name);
 460         result.append("; isReadable: ").append(isReadable);
 461         result.append("; isWritable: ").append(isWritable);
 462         result.append("; description: ").append(description);
 463         result.append("; minimum degree: ").append(minDegree);
 464         result.append("; maximum degree: ").append(maxDegree);
 465         result.append("; MBean class: ").append(referencedMBeanClassName);
 466         return result.toString();
 467     }
 468 
 469     //
 470     // Misc
 471     //
 472 
 473     // Initialization
 474     private void init(String roleName,
 475                       String mbeanClassName,
 476                       boolean read,
 477                       boolean write,
 478                       int min,
 479                       int max,
 480                       String descr)
 481             throws IllegalArgumentException,
 482                    InvalidRoleInfoException {
 483 
 484         if (roleName == null ||
 485             mbeanClassName == null) {