Package com.yahoo.protect
Class ClassValidator
- java.lang.Object
-
- com.yahoo.protect.ClassValidator
-
public final class ClassValidator extends java.lang.Object
Static utility methods to validate class properties.Do note, this class will not be a reliable guarantee for correctness if you have a forest of methods only differing by return type (as contradistinguished from name and argument types), the current implementation is minimal.
- Author:
- Steinar Knutsen
-
-
Constructor Summary
Constructors Constructor Description ClassValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.reflect.Method>
unmaskedMethods(java.lang.Class<?> testClass, java.lang.Class<?> maskedClass)
Check all protected, public and package private declared methods of maskedClass is implemented in testClass.static java.util.List<java.lang.reflect.Method>
unmaskedMethodsFromSuperclass(java.lang.Class<?> testClass)
Check testClass overrides all protected, public and package private methods of its immediate super class.
-
-
-
Method Detail
-
unmaskedMethods
public static java.util.List<java.lang.reflect.Method> unmaskedMethods(java.lang.Class<?> testClass, java.lang.Class<?> maskedClass)
Check all protected, public and package private declared methods of maskedClass is implemented in testClass. Note, this will by definition blow up on final methods in maskedClass.- Parameters:
testClass
- class which wraps or masks another classmaskedClass
- class which is masked or wrapped- Returns:
- the methods which seem to miss from testClass to be complete
-
unmaskedMethodsFromSuperclass
public static java.util.List<java.lang.reflect.Method> unmaskedMethodsFromSuperclass(java.lang.Class<?> testClass)
Check testClass overrides all protected, public and package private methods of its immediate super class. See unmaskedMethods().- Parameters:
testClass
- the class to check whether completely masks its super class- Returns:
- the methods missing from testClass to completely override its immediate super class
-
-