@HashCodeAndEqualsPlugin.Enhance public static class InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance extends java.lang.Object implements InvokeDynamic.InvocationProvider.ArgumentProvider
InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper, InvokeDynamic.InvocationProvider.ArgumentProvider.ForBooleanConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForByteConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForCharacterConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForClassConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForDoubleConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForEnumerationValue, InvokeDynamic.InvocationProvider.ArgumentProvider.ForField, InvokeDynamic.InvocationProvider.ArgumentProvider.ForFloatConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance, InvokeDynamic.InvocationProvider.ArgumentProvider.ForIntegerConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInterceptedMethodInstanceAndParameters, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInterceptedMethodParameters, InvokeDynamic.InvocationProvider.ArgumentProvider.ForJavaConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForLongConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForMethodParameter, InvokeDynamic.InvocationProvider.ArgumentProvider.ForNullValue, InvokeDynamic.InvocationProvider.ArgumentProvider.ForShortConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForStringConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForThisInstance, InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
FIELD_PREFIX
The prefix of any field generated by this argument provider.
|
private TypeDescription |
fieldType
The type of the static field.
|
private java.lang.String |
name
The name of the field.
|
private java.lang.Object |
value
The value that is stored in the static field.
|
Modifier | Constructor and Description |
---|---|
protected |
ForInstance(java.lang.Object value,
TypeDescription fieldType)
Creates a new argument provider that stores the given value in a static field.
|
Modifier and Type | Method and Description |
---|---|
protected static InvokeDynamic.InvocationProvider.ArgumentProvider |
of(java.lang.Object value)
Creates a new argument provider that stores the given value in a static field of the instance type.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.
|
InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved |
resolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
Assigner assigner,
Assigner.Typing typing)
Resolves an argument provider.
|
private static final java.lang.String FIELD_PREFIX
private final java.lang.Object value
private final TypeDescription fieldType
@HashCodeAndEqualsPlugin.ValueHandling(value=IGNORE) private final java.lang.String name
protected ForInstance(java.lang.Object value, TypeDescription fieldType)
value
- The value that is to be provided to the bootstrapped method.fieldType
- The type of the field which is also provided to the bootstrap method.protected static InvokeDynamic.InvocationProvider.ArgumentProvider of(java.lang.Object value)
value
- The value that is to be provided to the bootstrapped method.public InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing)
resolve
in interface InvokeDynamic.InvocationProvider.ArgumentProvider
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.assigner
- The assigner to be used.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.public InstrumentedType prepare(InstrumentedType instrumentedType)
prepare
in interface InvokeDynamic.InvocationProvider.ArgumentProvider
instrumentedType
- The instrumented type.