1 23 24 package com.sun.appserv.management.util.jmx; 25 26 import javax.management.MBeanAttributeInfo ; 27 28 import com.sun.appserv.management.util.jmx.stringifier.MBeanAttributeInfoStringifier; 29 import com.sun.appserv.management.util.jmx.stringifier.MBeanFeatureInfoStringifierOptions; 30 31 34 public final class MBeanAttributeInfoComparator implements java.util.Comparator <MBeanAttributeInfo > 35 { 36 private static final MBeanAttributeInfoStringifier ATTRIBUTE_INFO_STRINGIFIER = 37 new MBeanAttributeInfoStringifier( new MBeanFeatureInfoStringifierOptions( false, ",") ); 38 39 public static final MBeanAttributeInfoComparator INSTANCE = new MBeanAttributeInfoComparator(); 40 41 private MBeanAttributeInfoComparator() {} 42 43 public int 44 compare( final MBeanAttributeInfo o1, final MBeanAttributeInfo o2 ) 45 { 46 final String s1 = ATTRIBUTE_INFO_STRINGIFIER.stringify( o1 ); 47 final String s2 = ATTRIBUTE_INFO_STRINGIFIER.stringify( o2 ); 48 49 return( s1.compareTo( s2 ) ); 50 } 51 52 public boolean 53 equals( Object other ) 54 { 55 return( other instanceof MBeanAttributeInfoComparator ); 56 } 57 } 58 59 60 61 62 63 | Popular Tags |