CHJani / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

allow setFields to be chainable #377

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-api-java-client.googlecode.com/hg/apis/calendar/v3/com/goo
gle/api/services/calendar/CalendarRequest.html#setFields(java.lang.String)

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

Let's say I want to add the fields mask on a request, I'd expect to be able to 
do this for example:

      CalendarList feed = client.calendarList().list().setFields("items(id,summary)").execute();

But that gives a compilation error saying that CalendarRequest doesn't have an 
execute() method.

Expected fix: override setFields in CalendarList to change the return type to 
CalendarList.  Similarly for all request classes for all Google services.

Original issue reported on code.google.com by yan...@google.com on 20 Dec 2011 at 2:18

GoogleCodeExporter commented 9 years ago
Current workaround is to do declare a local variable like this:

      com.google.api.services.calendar.Calendar.CalendarList.List listRequest =
          client.calendarList().list();
      listRequest.setFields("items(id,summary)");
      CalendarList feed = listRequest.execute();

Original comment by yan...@google.com on 20 Dec 2011 at 2:21

GoogleCodeExporter commented 9 years ago
This has been fixed a few months ago.

Original comment by rmis...@google.com on 25 Jan 2012 at 9:23