Package org.testng.internal
Interface IObject
-
- All Known Implementing Classes:
ClassImpl,NoOpTestClass
public interface IObjectRepresents the associations of a class with one or more instances. Relevant with@Factoryannotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIObject.IdentifiableArrayObjectA wrapper class that wraps around an array and associates a unique Id that can be used as a key for the array.static classIObject.IdentifiableObjectA wrapper object that associates a unique id to every unique test class object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddObject(IObject.IdentifiableObject instance)static java.util.Optional<IObject>cast(java.lang.Object object)long[]getInstanceHashCodes()IObject.IdentifiableObject[]getObjects(boolean create, java.lang.String errorMsgPrefix)Returns all the instances the methods will be invoked upon.static long[]instanceHashCodes(java.lang.Object object)static IObject.IdentifiableObject[]objects(java.lang.Object object, boolean create)static IObject.IdentifiableObject[]objects(java.lang.Object object, boolean create, java.lang.String errorMsgPrefix)
-
-
-
Method Detail
-
getObjects
IObject.IdentifiableObject[] getObjects(boolean create, java.lang.String errorMsgPrefix)
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.- Parameters:
create- -trueif objects should be created before returning.errorMsgPrefix- - Text that should be prefixed to the error message when there are issues. Can be empty.- Returns:
- - An array of
IObject.IdentifiableObjectobjects
-
getInstanceHashCodes
long[] getInstanceHashCodes()
- Returns:
- - An array representing the hash codes of the corresponding instances.
-
addObject
void addObject(IObject.IdentifiableObject instance)
- Parameters:
instance- - The instance that should be added to the list of instances.
-
instanceHashCodes
static long[] instanceHashCodes(java.lang.Object object)
- Parameters:
object- - The object that should be inspected for its compatibility withIObject.- Returns:
- - An array representing the hash codes of the corresponding instances.
-
objects
static IObject.IdentifiableObject[] objects(java.lang.Object object, boolean create)
- Parameters:
object- - The object that should be inspected for its compatibility withIObject.create- -trueif objects should be created before returning.- Returns:
- - An array (can be empty is instance compatibility fails) of
IObject.IdentifiableObjectobjects.
-
objects
static IObject.IdentifiableObject[] objects(java.lang.Object object, boolean create, java.lang.String errorMsgPrefix)
- Parameters:
object- - The object that should be inspected for its compatibility withIObject.create- -trueif objects should be created before returning.errorMsgPrefix- - Text that should be prefixed to the error message when there are issues. Can be empty.- Returns:
- - An array (can be empty is instance compatibility fails) of
IObject.IdentifiableObjectobjects.
-
cast
static java.util.Optional<IObject> cast(java.lang.Object object)
-
-