agave-common/common-core/src/main/java/org/iplantc/service/common/search/SearchTerm.java
/**
		 * Null-safe filter for a search value. Known wildcards "*" will be
		 * resolved to "%" and the result returned. Lists will be returned
		 * unchanged. 
		 * 
		 * {@link Date} values are formatted to nanosecond precision with   
		 * either 0's or 1's so we guarantee we are accurate to the second
		 * regardless of the column precision in MySQL. All formatted dates
		 * are assumed to be in UTC. No adjustment is made at this level.
		 *   
		 * @param searchValue the search value
		 * @return the escaped, filtered search value with wildcards replaced.
		 */
Null-safe filter for a search value. Known wildcards "*" will be
resolved to "%" and the result returned. Lists will be returned
unchanged.

Date values are formatted to nanosecond precision with
either 0's or 1's so we guarantee we are accurate to the second
regardless of the column precision in MySQL. All formatted dates
are assumed to be in UTC. No adjustment is made at this level.

@param searchValue the search value
@return the escaped, filtered search value with wildcards replaced.
Null - safe filter for a search value . Known wildcards " * " will be resolved to " % " and the result returned . Lists will be returned unchanged . Date values are formatted to nanosecond precision with either 0 ' s or 1 ' s so we guarantee we are accurate to the second regardless of the column precision in MySQL . All formatted dates are assumed to be in UTC . No adjustment is made at this level . @param searchValue the search value @return the escaped filtered search value with wildcards replaced .
public Object applyWildcards(Object searchValue) {
			if (searchValue == null) {
				searchValue = "";
			} else if (searchValue instanceof List && this != ON) {
			    if (this == BETWEEN) {
			        List<String> dates = new ArrayList<String>();
			        boolean first = true;
			        for(Date d: (List<Date>)searchValue) {
			        	if (first) {
			        		dates.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.000000").format(d));
			        		first = false;
			        	}
			        	else {
			        		dates.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.999999").format(d));
			        	}
			        }
			        return dates;
			    } else {
			        return searchValue;
			    }
			} else if (searchValue instanceof Date) {
				if (this == ON) {
					List<String> dates = new ArrayList<>();
			        dates.add(new SimpleDateFormat("yyyy-MM-dd 00:00:00").format((Date)searchValue));
			        dates.add(new SimpleDateFormat("yyyy-MM-dd 23:59:59").format((Date)searchValue));
			        return dates;
			    } 
			    else if (this == GT || this == LTE || this == AFTER) {
			    	return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.999999").format((Date)searchValue);
			    }
			    else if (this == LT || this == GTE || this == BEFORE) {
			    	return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.000000").format((Date)searchValue);
			    }
			    else {
			        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.000000").format((Date)searchValue);
			    }
			}
			if (this == LIKE || this == NLIKE || this == RLIKE) {
				return searchValue.toString().replaceAll("\\*", "%");
			} else {
				return searchValue;
			}
		}
public Object applyWildcards ( Object searchValue ) { if ( searchValue == null ) { searchValue = "" ; } else if ( searchValue instanceof List && this != ON ) { if ( this == BETWEEN ) { List < String > dates = new ArrayList < String > ( ) ; boolean first = true ; for ( Date d : ( List < Date > ) searchValue ) { if ( first ) { dates . add ( new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.000000" ) . format ( d ) ) ; first = false ; } else { dates . add ( new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.999999" ) . format ( d ) ) ; } } return dates ; } else { return searchValue ; } } else if ( searchValue instanceof Date ) { if ( this == ON ) { List < String > dates = new ArrayList < > ( ) ; dates . add ( new SimpleDateFormat ( "yyyy-MM-dd 00:00:00" ) . format ( ( Date ) searchValue ) ) ; dates . add ( new SimpleDateFormat ( "yyyy-MM-dd 23:59:59" ) . format ( ( Date ) searchValue ) ) ; return dates ; } else if ( this == GT || this == LTE || this == AFTER ) { return new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.999999" ) . format ( ( Date ) searchValue ) ; } else if ( this == LT || this == GTE || this == BEFORE ) { return new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.000000" ) . format ( ( Date ) searchValue ) ; } else { return new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.000000" ) . format ( ( Date ) searchValue ) ; } } if ( this == LIKE || this == NLIKE || this == RLIKE ) { return searchValue . toString ( ) . replaceAll ( "\\*" , "%" ) ; } else { return searchValue ; } }
Null-safe filter for a search value.
Null - safe filter for a search value .
// single term 