Class ClassComparer
- java.lang.Object
-
- org.eclipse.collections.impl.test.ClassComparer
-
public class ClassComparer extends java.lang.ObjectThis class will compare the method signatures between two classes. The comparison can be based on the following method information:- Method Name
- Method Name + Parameter Types
- Method Name + Return Type
- Method Name + Parameter Types + Return Type
The operations that can be used to compare the method signatures of two classes are:
- Intersection
- Difference
- Symmetric difference
- isProperSubsetOf
- isProperSupersetOf
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Appendableappendableprivate static java.lang.StringDIFFERENCEprivate booleanincludeObjectMethodsprivate booleanincludePackageNamesprivate booleanincludeParameterTypesInMethodsprivate booleanincludeReturnTypesprivate static java.lang.StringINTERSECTIONprivate static java.lang.StringSYMMETRIC_DIFFERENCE
-
Constructor Summary
Constructors Constructor Description ClassComparer()ClassComparer(boolean includeParameterTypesInMethods, boolean includeReturnTypes, boolean includePackageNames)ClassComparer(java.lang.Appendable out)ClassComparer(java.lang.Appendable out, boolean includeParameterTypesInMethods, boolean includeReturnTypes, boolean includePackageNames)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringclassNames(Twin<java.lang.Class<?>> classPair)Triplet<MutableSortedSet<java.lang.String>>compare(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)Triplet<MutableSortedSet<java.lang.String>>compareAndPrint(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)MutableSortedSet<java.lang.String>difference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)MutableSortedSet<java.lang.String>getInstanceMethodNames(java.lang.Class<?> classOne)MutableSortedSet<java.lang.String>getMethodNames(java.lang.Class<?> classOne)private booleanincludeMethod(java.lang.reflect.Method method)voidincludeObjectMethods()MutableSortedSet<java.lang.String>intersect(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)static booleanisProperSubsetOf(java.lang.Class<?> subsetClass, java.lang.Class<?> supersetClass)static booleanisProperSubsetOfInstance(java.lang.Class<?> subsetClass, java.lang.Class<?> supersetClass)static booleanisProperSupersetOf(java.lang.Class<?> supersetClass, java.lang.Class<?> subsetClass)static booleanisProperSupersetOfInstance(java.lang.Class<?> supersetClass, java.lang.Class<?> subsetClass)private java.lang.StringmethodName(java.lang.reflect.Method method)private voidoutput(Twin<java.lang.Class<?>> classPair, java.lang.String operation, RichIterable<java.lang.String> strings)private voidoutputGroupByToString(RichIterable<java.lang.String> methods)private voidoutputTitle(java.lang.String title)private java.lang.StringparameterNames(java.lang.reflect.Method method)MutableSortedSet<java.lang.String>printClass(java.lang.Class<?> clazz)MutableSortedSet<java.lang.String>printDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)MutableSortedSet<java.lang.String>printIntersection(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)MutableSortedSet<java.lang.String>printSymmetricDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)MutableSortedSet<java.lang.String>symmetricDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
-
-
Field Detail
-
SYMMETRIC_DIFFERENCE
private static final java.lang.String SYMMETRIC_DIFFERENCE
- See Also:
- Constant Field Values
-
INTERSECTION
private static final java.lang.String INTERSECTION
- See Also:
- Constant Field Values
-
DIFFERENCE
private static final java.lang.String DIFFERENCE
- See Also:
- Constant Field Values
-
includeParameterTypesInMethods
private final boolean includeParameterTypesInMethods
-
includeReturnTypes
private final boolean includeReturnTypes
-
includePackageNames
private final boolean includePackageNames
-
includeObjectMethods
private boolean includeObjectMethods
-
appendable
private final java.lang.Appendable appendable
-
-
Constructor Detail
-
ClassComparer
public ClassComparer()
-
ClassComparer
public ClassComparer(java.lang.Appendable out)
-
ClassComparer
public ClassComparer(boolean includeParameterTypesInMethods, boolean includeReturnTypes, boolean includePackageNames)
-
ClassComparer
public ClassComparer(java.lang.Appendable out, boolean includeParameterTypesInMethods, boolean includeReturnTypes, boolean includePackageNames)
-
-
Method Detail
-
isProperSupersetOf
public static boolean isProperSupersetOf(java.lang.Class<?> supersetClass, java.lang.Class<?> subsetClass)
-
isProperSubsetOf
public static boolean isProperSubsetOf(java.lang.Class<?> subsetClass, java.lang.Class<?> supersetClass)
-
isProperSupersetOfInstance
public static boolean isProperSupersetOfInstance(java.lang.Class<?> supersetClass, java.lang.Class<?> subsetClass)
-
isProperSubsetOfInstance
public static boolean isProperSubsetOfInstance(java.lang.Class<?> subsetClass, java.lang.Class<?> supersetClass)
-
compare
public Triplet<MutableSortedSet<java.lang.String>> compare(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
difference
public MutableSortedSet<java.lang.String> difference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
printDifference
public MutableSortedSet<java.lang.String> printDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
symmetricDifference
public MutableSortedSet<java.lang.String> symmetricDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
printSymmetricDifference
public MutableSortedSet<java.lang.String> printSymmetricDifference(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
intersect
public MutableSortedSet<java.lang.String> intersect(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
printIntersection
public MutableSortedSet<java.lang.String> printIntersection(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
printClass
public MutableSortedSet<java.lang.String> printClass(java.lang.Class<?> clazz)
-
compareAndPrint
public Triplet<MutableSortedSet<java.lang.String>> compareAndPrint(java.lang.Class<?> leftClass, java.lang.Class<?> rightClass)
-
output
private void output(Twin<java.lang.Class<?>> classPair, java.lang.String operation, RichIterable<java.lang.String> strings)
-
classNames
private java.lang.String classNames(Twin<java.lang.Class<?>> classPair)
-
getMethodNames
public MutableSortedSet<java.lang.String> getMethodNames(java.lang.Class<?> classOne)
-
getInstanceMethodNames
public MutableSortedSet<java.lang.String> getInstanceMethodNames(java.lang.Class<?> classOne)
-
includeObjectMethods
public void includeObjectMethods()
-
includeMethod
private boolean includeMethod(java.lang.reflect.Method method)
-
methodName
private java.lang.String methodName(java.lang.reflect.Method method)
-
parameterNames
private java.lang.String parameterNames(java.lang.reflect.Method method)
-
outputTitle
private void outputTitle(java.lang.String title)
-
outputGroupByToString
private void outputGroupByToString(RichIterable<java.lang.String> methods)
-
-