public static void decodeProperties ( Set < PropertyCriteria > properties , String encoded ) { if ( encoded != null && ! encoded . trim ( ) . isEmpty ( ) ) { StringTokenizer st = new StringTokenizer ( encoded , "," ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; String [ ] parts = token . split ( "[|]" ) ; if ( parts . length >= 2 ) { String name = parts [ 0 ] . trim ( ) ; String value = parts [ 1 ] . trim ( ) ; Operator op = Operator . HAS ; if ( parts . length > 2 ) { op = Operator . valueOf ( parts [ 2 ] . trim ( ) ) ; } log . tracef ( "Extracted property name [%s] value [%s] operator [%s]" , name , value , op ) ; properties . add ( new PropertyCriteria ( name , value , op ) ) ; } } } }
This method processes a comma separated list of properties defined as a name|value pair .