Class PioneerUtils
java.lang.Object
org.junitpioneer.internal.PioneerUtils
Pioneer-internal utility class.
DO NOT USE THIS CLASS - IT MAY CHANGE SIGNIFICANTLY IN ANY MINOR UPDATE.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> voidaddButThrowIfDuplicate(Set<T> set, T element) cartesianProduct(List<List<?>> lists) static LocalecreateLocale(String language) static LocalecreateLocale(String language, String country) static LocalecreateLocale(String language, String country, String variant) static List<org.junit.jupiter.api.extension.ExtensionContext> findAllContexts(org.junit.jupiter.api.extension.ExtensionContext context) Find all (parent)ExtensionContexts viaExtensionContext.getParent().findMethodCurrentOrEnclosing(Class<?> clazz, String methodName, Class<?>... parameterTypes) Find the firstMethodof the supplied class or interface that meets the specified criteria, beginning with the specified class or interface and traversing its enclosing classes until such a method is found or the top level class is reached.static StringnullSafeToString(Object object) static <T> Class<T> Replaces all primitive types with the appropriate wrapper types.
-
Constructor Details
-
PioneerUtils
private PioneerUtils()
-
-
Method Details
-
distinctToSet
-
addButThrowIfDuplicate
-
findMethodCurrentOrEnclosing
public static Optional<Method> findMethodCurrentOrEnclosing(Class<?> clazz, String methodName, Class<?>... parameterTypes) Find the firstMethodof the supplied class or interface that meets the specified criteria, beginning with the specified class or interface and traversing its enclosing classes until such a method is found or the top level class is reached.The algorithm does not search for methods in
Object.- Parameters:
clazz- the class or interface in which to find the method; nevernullmethodName- the name of the method to find; nevernullor emptyparameterTypes- the types of parameters accepted by the method, if any; nevernull- Returns:
- an
Optionalcontaining the method found; nevernullbut potentially empty if no such method could be found - See Also:
-
findAllContexts
public static List<org.junit.jupiter.api.extension.ExtensionContext> findAllContexts(org.junit.jupiter.api.extension.ExtensionContext context) Find all (parent)ExtensionContexts viaExtensionContext.getParent().- Parameters:
context- the context for which to find all (parent) contexts; nevernull- Returns:
- a list of all contexts, "outwards" in the
getParent-order, beginning with the given context; nevernullor empty
-
nullSafeToString
-
wrap
Replaces all primitive types with the appropriate wrapper types. Returns the passed argument if it's not a primitive according toClass.isPrimitive().- Returns:
- the wrapped class of the primitive type, or the passed class
- See Also:
-
cartesianProduct
-
createLocale
-
createLocale
-
createLocale
-