Code example for FilterDefinition

Methods: getParameterType

0
	 */ 
	public Filter setParameter(String name, Object value) throws IllegalArgumentException {
		// Make sure this is a defined parameter and check the incoming value type 
		// TODO: what should be the actual exception type here? 
		Type type = definition.getParameterType( name );
		if ( type == null ) {
			throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
		} 
		if ( value != null && !type.getReturnedClass().isAssignableFrom( value.getClass() ) ) {
			throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
		} 
		parameters.put( name, value );
		return this;
	} 
 
	/** 
	 * Set the named parameter's value list for this filter.  Used 
	 * in conjunction with IN-style filter criteria. 
	 * 
	 * @param name   The parameter's name. 
Stop searching for code, let great code find you!  Add Codota to your java IDE