Class ImmutableTestInfo
- java.lang.Object
-
- com.github.jonasrutishauser.cdi.test.api.ImmutableTestInfo
-
- All Implemented Interfaces:
TestInfo
@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTestInfo extends Object implements TestInfo
Immutable implementation ofTestInfo.Use the builder to create immutable instances:
ImmutableTestInfo.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTestInfo.BuilderBuilds instances of typeImmutableTestInfo.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTestInfo.Builderbuilder()Creates a builder forImmutableTestInfo.static ImmutableTestInfocopyOf(TestInfo instance)Creates an immutable copy of aTestInfovalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTestInfothat have equal attribute values.Class<?>getTestClass()ObjectgetTestInstance()MethodgetTestMethod()StringgetTestName()inthashCode()Computes a hash code from attributes:testInstance,testClass,testMethod,testName.StringtoString()Prints the immutable valueTestInfowith attribute values.ImmutableTestInfowithTestClass(Class<?> value)Copy the current immutable object by setting a value for thetestClassattribute.ImmutableTestInfowithTestInstance(Object value)Copy the current immutable object by setting a value for thetestInstanceattribute.ImmutableTestInfowithTestMethod(Method value)Copy the current immutable object by setting a value for thetestMethodattribute.ImmutableTestInfowithTestName(String value)Copy the current immutable object by setting a value for thetestNameattribute.
-
-
-
Method Detail
-
getTestInstance
public Object getTestInstance()
- Specified by:
getTestInstancein interfaceTestInfo- Returns:
- The value of the
testInstanceattribute
-
getTestClass
public Class<?> getTestClass()
- Specified by:
getTestClassin interfaceTestInfo- Returns:
- The value of the
testClassattribute
-
getTestMethod
public Method getTestMethod()
- Specified by:
getTestMethodin interfaceTestInfo- Returns:
- The value of the
testMethodattribute
-
getTestName
public String getTestName()
- Specified by:
getTestNamein interfaceTestInfo- Returns:
- The value of the
testNameattribute
-
withTestInstance
public final ImmutableTestInfo withTestInstance(Object value)
Copy the current immutable object by setting a value for thetestInstanceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for testInstance- Returns:
- A modified copy of the
thisobject
-
withTestClass
public final ImmutableTestInfo withTestClass(Class<?> value)
Copy the current immutable object by setting a value for thetestClassattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for testClass- Returns:
- A modified copy of the
thisobject
-
withTestMethod
public final ImmutableTestInfo withTestMethod(Method value)
Copy the current immutable object by setting a value for thetestMethodattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for testMethod- Returns:
- A modified copy of the
thisobject
-
withTestName
public final ImmutableTestInfo withTestName(String value)
Copy the current immutable object by setting a value for thetestNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for testName- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(Object another)
This instance is equal to all instances ofImmutableTestInfothat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:testInstance,testClass,testMethod,testName.
-
toString
public String toString()
Prints the immutable valueTestInfowith attribute values.
-
copyOf
public static ImmutableTestInfo copyOf(TestInfo instance)
Creates an immutable copy of aTestInfovalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable TestInfo instance
-
builder
public static ImmutableTestInfo.Builder builder()
Creates a builder forImmutableTestInfo.ImmutableTestInfo.builder() .testInstance(Object) // requiredtestInstance.testClass(Class<?>) // requiredtestClass.testMethod(reflect.Method) // requiredtestMethod.testName(String) // requiredtestName.build();- Returns:
- A new ImmutableTestInfo builder
-
-