cdc.issues.checks.AbstractPropertyChecker Maven / Gradle / Ivy
package cdc.issues.checks;
import cdc.issues.rules.Rule;
import cdc.util.lang.Checks;
/**
* Specialization of {@link AbstractRuleChecker} that can check a single property of an object.
*
* Location is that of the object.
*
* @param The object type.
* @param The property type.
*/
public abstract class AbstractPropertyChecker extends AbstractRuleChecker {
private final Class propertyClass;
protected AbstractPropertyChecker(SnapshotManager manager,
Class objectClass,
Rule rule,
Class propertyClass) {
super(manager,
objectClass,
rule);
this.propertyClass = Checks.isNotNull(propertyClass, "propertyClass");
}
/**
* @return The property class.
*/
public final Class
getPropertyClass() {
return propertyClass;
}
/**
* @param object The object
* @return The property.
*/
protected abstract P getProperty(O object);
}