public static WQConstraint decode ( final String field , final String rawValue ) { final WQFunctionType function ; final String value ; if ( StringUtils . equalsIgnoreCase ( rawValue , WQFunctionType . IS_NULL . getPrefix ( ) ) ) return new WQConstraint ( field , WQFunctionType . IS_NULL , null ) ; else if ( StringUtils . equalsIgnoreCase ( rawValue , WQFunctionType . NOT_NULL . getPrefix ( ) ) ) return new WQConstraint ( field , WQFunctionType . NOT_NULL , null ) ; else if ( rawValue . startsWith ( "_f_" ) ) { function = WQFunctionType . getByPrefix ( rawValue ) ; if ( function . hasParam ( ) ) { // Strip the function name from the value value = rawValue . substring ( function . getPrefix ( ) . length ( ) ) ; if ( function . hasBinaryParam ( ) ) { final String [ ] splitValues = StringUtils . split ( value , ".." , 2 ) ; final String left = splitValues [ 0 ] ; final String right = splitValues [ 1 ] ; return new WQConstraint ( field , function , left , right ) ; } } else { value = null ; } } else { function = WQFunctionType . EQ ; value = rawValue ; } return new WQConstraint ( field , function , value ) ; }
Produce a WebQueryConstraint from a Query String format parameter