> + this.page = page;
> + return this;
> + }
> +
> + public UserOptions build() {
> + UserOptions options = new UserOptions();
> +
> + if ( limit != null ) {
> + options.queryParameters.put("numResults",
> String.valueOf(limit));
> + // Remove the "limit" parameter: it has been
> replaced by "numResults"
> + limit = null;
> + }
> +
> + if ( page != null ) {
> + options.queryParameters.put("page",
> String.valueOf(page));
> + }
Yes, I would overwrite the method. That would leave the builders more
clean. I'll take care of changing the other builders accordingly in a
separate PR.
El 16/08/2013 12:21, "Carlos García Ibáñez" <[email protected]>
escribió:
> In
> abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/UserOptions.java:
>
> > + this.page = page;
> > + return this;
> > + }
> > +
> > + public UserOptions build() {
> > + UserOptions options = new UserOptions();
> > +
> > + if ( limit != null ) {
> > + options.queryParameters.put("numResults",
> > String.valueOf(limit));
> > + // Remove the "limit" parameter: it has been
> > replaced by "numResults"
> > + limit = null;
> > + }
> > +
> > + if ( page != null ) {
> > + options.queryParameters.put("page",
> > String.valueOf(page));
> > + }
>
> I think it's a good idea. But I should override the limit(() method to
> get this behaviuor, shouldn' I?
>
> if ( limit != null ) {
> options.queryParameters.put("numResults", String.valueOf(limit));
> // Remove the "limit" parameter: it has been replaced by "numResults"
> limit = null;
> }
>
> —
> Reply to this email directly or view it on
> GitHub<https://github.com/jclouds/jclouds-labs/pull/22/files#r5811239>
> .
>
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/22/files#r5811498