io.sarl.lang.util
Class ReflectField<RT, T>
Type Parameters:
RT - the type of the receiver.
T - the type of the returned value.
final class ReflectField<RT, T>
extends java.lang.Object
Utility class for accessing to a field by reflection.
Parameters:
<RT> - the type of the receiver.
<T> - the type of the returned value.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.13
Constructor Summary
Constructor and description
new(Class<T>,Class<T>,String)
Constructor.
Action Summary
Modifier and type Action and description
T get
Get the value from the static field.
T get(RT)
Get the value from the field from an object.
static ReflectField<RT,T> of(Class<T>,Class<T>,String)
Static constructor.
Constructor Details
new(Class<T>,Class<T>,String)
protected new(Class<T>,Class<T>,String)
Constructor.
Parameters:
receiverType - the type of the receiver.
returnType - the type of the returned values.
fieldName - the name of the field.
Action Details
get
def get : T
Get the value from the static field.
Returns:
the value.
get(RT)
def get(RT) : T
Get the value from the field from an object.
Parameters:
receiver - the receiver.
Returns:
the value.
of(Class<T>,Class<T>,String)
def of(Class<T>,Class<T>,String) : ReflectField<RT,T>

with RT, T

Static constructor.
Parameters:
<RT> - the type of the receiver.
<T> - the type of the returned value.
receiverType - the type of the receiver.
returnType - the type of the returned values.
fieldName - the name of the field.
Returns:
the instance.