org.unitils.objectvalidation.rules.ClassIsFinalRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unitils-objectvalidation Show documentation
Show all versions of unitils-objectvalidation Show documentation
Unitils module to validate objects.
package org.unitils.objectvalidation.rules;
import static java.lang.reflect.Modifier.isFinal;
import static org.junit.Assert.assertTrue;
import org.unitils.objectvalidation.Rule;
/**
* Rule to check that the class is final.
*
* @author Matthieu Mestrez
* @since Oct 24, 2013
*/
public class ClassIsFinalRule implements Rule {
@Override
public void validate(Class> classToValidate) {
assertTrue("Class was not final.", isFinal(classToValidate.getModifiers()));
}
}