Package org.testng.internal
Class ObjectBag
- java.lang.Object
-
- org.testng.internal.ObjectBag
-
public final class ObjectBag extends java.lang.Object
A simple bean bag that is intended to help share objects during the lifetime of TestNG without needing it to be a singleton.
-
-
Constructor Summary
Constructors Constructor Description ObjectBag()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
static void
cleanup(ISuite suite)
java.lang.Object
createIfRequired(java.lang.Class<?> type, java.util.function.Supplier<java.lang.Object> supplier)
static ObjectBag
getInstance(ISuite suite)
static ObjectBag
getInstance(XmlSuite xmlSuite)
-
-
-
Method Detail
-
cleanup
public static void cleanup(ISuite suite)
-
createIfRequired
public java.lang.Object createIfRequired(java.lang.Class<?> type, java.util.function.Supplier<java.lang.Object> supplier)
- Parameters:
type
- - The type of the object to be createdsupplier
- - ASupplier
that should be used to produce a new instance- Returns:
- - Either the newly produced instance or the existing instance.
-
cleanup
public void cleanup()
-
-