code: public static <T> T getValue(Object obj, String fieldName, Class<T> fieldType) {
      try {
        return getValue(obj, getField(obj.getClass(), fieldName), fieldType);
      }
      catch (FieldNotFoundException e) {
        throw new IllegalArgumentException(String.format("Field with name (%1$s) does not exist on object of type (%2$s)!",
          fieldName, obj.getClass().getName()), e);
      }
    }
docs: Gets the value of the field with the specified name on the given object cast to the desired field type.
  This method assumes the field is a instance (object) member field.
  
  @param <T> the desired return type in which the field's value will be cast; should be compatible with
  the field's declared type.
  @param obj the Object on which the field is defined.
  @param fieldName a String indicating the name of the field from which to get the value.
  @param fieldType the declared type of the object's field.
  @return the value of the specified field on the given object cast to the desired type.
  @throws IllegalArgumentException if the given object's class type does not declare a instance member field
  with the specified name.
  @throws FieldAccessException if the value for the specified field could not be retrieved.
  @see #getField(Class, String)
  @see #getValue(Object, java.lang.reflect.Field, Class)