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

com.dooapp.gaedo.finders.collections.EqualsEvaluator Maven / Gradle / Ivy

There is a newer version: 1.0.16
Show newest version
package com.dooapp.gaedo.finders.collections;

import java.lang.reflect.Field;

import com.dooapp.gaedo.properties.Property;

/**
 * Check if source field value is equals to memoized value
 * @author ndx
 *
 */
public class EqualsEvaluator extends AbstractBasicEvaluator {
	/**
	 * Checked value
	 */
	private final Object value;
	
	public EqualsEvaluator(Property source, Object value) {
		super(source);
		this.value = value;
	}

	public boolean matches(DataType element) {
		Object retrieved = getValue(element);
		return (value==null && retrieved==null) || (value!=null && value.equals(retrieved));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy