All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anodoc.query2.QueryInProperty Maven / Gradle / Ivy

There is a newer version: 4.3.0
Show newest version
package net.anotheria.anodoc.query2;

import java.util.Collection;

import net.anotheria.util.StringUtils;

/**
 * Difference with QueryProperty is collection of possible values instead of single value.
 *
 * IMPORTANT:Tested only in postgressql!
 *
 * @author denis
 * @version $Id: $Id
 */
public class QueryInProperty extends QueryProperty{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8649073486730051958L;

	/**
	 * 

Constructor for QueryInProperty.

* * @param aName a {@link java.lang.String} object. * @param aValues a {@link java.util.Collection} object. */ public QueryInProperty(String aName, Collection aValues){ super(aName, aValues); } /** {@inheritDoc} */ @Override public boolean doesMatch(Object o) { return o== null ?getOriginalValue() == null : getListValue().contains(o); } /** {@inheritDoc} */ @Override public String getComparator() { return " IN "; } /** {@inheritDoc} */ @Override public Object getValue() { Collection values = getListValue(); return StringUtils.surroundWith(StringUtils.concatenateTokens(values, ',', '\'', '\''), '(', ')'); } @SuppressWarnings("unchecked") private Collection getListValue(){ return (Collection) getOriginalValue(); } /** {@inheritDoc} */ @Override public boolean unprepaireable() { return true; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy