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 class
ImmutableTestInfo.Builder
Builds instances of typeImmutableTestInfo
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTestInfo.Builder
builder()
Creates a builder forImmutableTestInfo
.static ImmutableTestInfo
copyOf(TestInfo instance)
Creates an immutable copy of aTestInfo
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableTestInfo
that have equal attribute values.Class<?>
getTestClass()
Object
getTestInstance()
Method
getTestMethod()
String
getTestName()
int
hashCode()
Computes a hash code from attributes:testInstance
,testClass
,testMethod
,testName
.String
toString()
Prints the immutable valueTestInfo
with attribute values.ImmutableTestInfo
withTestClass(Class<?> value)
Copy the current immutable object by setting a value for thetestClass
attribute.ImmutableTestInfo
withTestInstance(Object value)
Copy the current immutable object by setting a value for thetestInstance
attribute.ImmutableTestInfo
withTestMethod(Method value)
Copy the current immutable object by setting a value for thetestMethod
attribute.ImmutableTestInfo
withTestName(String value)
Copy the current immutable object by setting a value for thetestName
attribute.
-
-
-
Method Detail
-
getTestInstance
public Object getTestInstance()
- Specified by:
getTestInstance
in interfaceTestInfo
- Returns:
- The value of the
testInstance
attribute
-
getTestClass
public Class<?> getTestClass()
- Specified by:
getTestClass
in interfaceTestInfo
- Returns:
- The value of the
testClass
attribute
-
getTestMethod
public Method getTestMethod()
- Specified by:
getTestMethod
in interfaceTestInfo
- Returns:
- The value of the
testMethod
attribute
-
getTestName
public String getTestName()
- Specified by:
getTestName
in interfaceTestInfo
- Returns:
- The value of the
testName
attribute
-
withTestInstance
public final ImmutableTestInfo withTestInstance(Object value)
Copy the current immutable object by setting a value for thetestInstance
attribute. 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
this
object
-
withTestClass
public final ImmutableTestInfo withTestClass(Class<?> value)
Copy the current immutable object by setting a value for thetestClass
attribute. 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
this
object
-
withTestMethod
public final ImmutableTestInfo withTestMethod(Method value)
Copy the current immutable object by setting a value for thetestMethod
attribute. 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
this
object
-
withTestName
public final ImmutableTestInfo withTestName(String value)
Copy the current immutable object by setting a value for thetestName
attribute. 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
this
object
-
equals
public boolean equals(Object another)
This instance is equal to all instances ofImmutableTestInfo
that 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 valueTestInfo
with attribute values.
-
copyOf
public static ImmutableTestInfo copyOf(TestInfo instance)
Creates an immutable copy of aTestInfo
value. 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) // required
testInstance
.testClass(Class<?>) // requiredtestClass
.testMethod(reflect.Method) // requiredtestMethod
.testName(String) // requiredtestName
.build();- Returns:
- A new ImmutableTestInfo builder
-
-