@HashCodeAndEqualsPlugin.Enhance public static class ExceptionMethod.ConstructionDelegate.ForStringConstructor extends java.lang.Object implements ExceptionMethod.ConstructionDelegate
ExceptionMethod.ConstructionDelegate.ForDefaultConstructor, ExceptionMethod.ConstructionDelegate.ForStringConstructor
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
message
The
String that is to be passed to the exception's constructor. |
private MethodDescription |
targetConstructor
The constructor that is used for creating the exception.
|
private TypeDescription |
throwableType
The type of the exception that is to be thrown.
|
Constructor and Description |
---|
ForStringConstructor(TypeDescription throwableType,
java.lang.String message)
Creates a new construction delegate that calls a constructor by handing it the given string.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation |
make()
Creates a stack manipulation that creates pushes all constructor arguments onto the operand stack
and subsequently calls the constructor.
|
private final TypeDescription throwableType
private final MethodDescription targetConstructor
private final java.lang.String message
String
that is to be passed to the exception's constructor.public ForStringConstructor(TypeDescription throwableType, java.lang.String message)
throwableType
- The type of the Throwable
.message
- The string that is handed to the constructor.public StackManipulation make()
make
in interface ExceptionMethod.ConstructionDelegate
Throwable
.