Ejemplo n.º 1
0
 /**
  * Returns a method handle for a getter of the given field.
  *
  * @param fieldDescription The field to represent.
  * @return A method handle for a getter of the given field.
  */
 public static MethodHandle ofSetter(FieldDescription fieldDescription) {
   return new MethodHandle(
       HandleType.ofSetter(fieldDescription),
       fieldDescription.getDeclaringType().asRawType(),
       fieldDescription.getInternalName(),
       TypeDescription.VOID,
       Collections.singletonList(fieldDescription.getType().asRawType()));
 }
Ejemplo n.º 2
0
 /**
  * Returns a method handle for a setter of the given field.
  *
  * @param fieldDescription The field to represent.
  * @return A method handle for a setter of the given field.
  */
 public static MethodHandle ofGetter(FieldDescription fieldDescription) {
   return new MethodHandle(
       HandleType.ofGetter(fieldDescription),
       fieldDescription.getDeclaringType().asRawType(),
       fieldDescription.getInternalName(),
       fieldDescription.getType().asRawType(),
       Collections.<TypeDescription>emptyList());
 }