Example #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()));
 }
Example #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());
 }