T
- The type of the value that is set as a value to the field.public static class LoadedTypeInitializer.ForStaticField<T> extends Object implements LoadedTypeInitializer, Serializable
LoadedTypeInitializer.Compound, LoadedTypeInitializer.ForStaticField<T>, LoadedTypeInitializer.NoOp
Modifier | Constructor and Description |
---|---|
protected |
ForStaticField(String fieldName,
T value,
boolean makeAccessible)
Creates a new
LoadedTypeInitializer for setting a static field. |
Modifier and Type | Method and Description |
---|---|
static LoadedTypeInitializer |
accessible(String fieldName,
Object value)
Creates a
LoadedTypeInitializer for given field name and value where the
field is accessible by reflection. |
boolean |
equals(Object other) |
int |
hashCode() |
boolean |
isAlive()
Indicates if this initializer is alive and needs to be invoked.
|
static LoadedTypeInitializer |
nonAccessible(String fieldName,
Object value)
Creates a
LoadedTypeInitializer for given field name and value where the
field is not accessible by reflection and needs to be prepared accordingly. |
void |
onLoad(Class<?> type)
Callback that is invoked on the creation of an instrumented type.
|
String |
toString() |
protected ForStaticField(String fieldName, T value, boolean makeAccessible)
LoadedTypeInitializer
for setting a static field.fieldName
- the name of the field.value
- The value to be set.makeAccessible
- Whether the field should be made accessible.public static LoadedTypeInitializer accessible(String fieldName, Object value)
LoadedTypeInitializer
for given field name and value where the
field is accessible by reflection.fieldName
- The name of the field.value
- The value to set.LoadedTypeInitializer
.public static LoadedTypeInitializer nonAccessible(String fieldName, Object value)
LoadedTypeInitializer
for given field name and value where the
field is not accessible by reflection and needs to be prepared accordingly.fieldName
- The name of the field.value
- The value to set.LoadedTypeInitializer
.public void onLoad(Class<?> type)
LoadedTypeInitializer
onLoad
in interface LoadedTypeInitializer
type
- The manifestation of the instrumented type.public boolean isAlive()
LoadedTypeInitializer
isAlive
in interface LoadedTypeInitializer
true
if this initializer is alive.Copyright © 2014–2015. All rights reserved.