public static MessageSelectorBuilder fromKeyValueMap ( Map < String , Object > valueMap ) { StringBuffer buf = new StringBuffer ( ) ; Iterator < Entry < String , Object > > iter = valueMap . entrySet ( ) . iterator ( ) ; if ( iter . hasNext ( ) ) { Entry < String , Object > entry = iter . next ( ) ; String key = entry . getKey ( ) ; String value = entry . getValue ( ) . toString ( ) ; buf . append ( key + " = '" + value + "'" ) ; } while ( iter . hasNext ( ) ) { Entry < String , Object > entry = iter . next ( ) ; String key = entry . getKey ( ) ; String value = entry . getValue ( ) . toString ( ) ; buf . append ( " AND " + key + " = '" + value + "'" ) ; } return new MessageSelectorBuilder ( buf . toString ( ) ) ; }
Static builder method using a key value map .