jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] [JCLOUDS-1007] Implemented Docker Exec support in MiscApi (#205)
Date Thu, 01 Oct 2015 22:05:11 GMT
> +    * {@link #attachStderr()} and {@link #attachStdout()} to true as a default.
> +    *
> +    * @return new {@link ExecCreateParams.Builder} instance
> +    */
> +   public static Builder builder() {
> +      return new AutoValue_ExecCreateParams.Builder().attachStderr(true).attachStdout(true);
> +   }
> +
> +   @AutoValue.Builder
> +   public abstract static class Builder {
> +
> +      public abstract Builder attachStdout(boolean b);
> +
> +      public abstract Builder attachStderr(boolean b);
> +
> +      public abstract Builder cmd(List<String> cmds);

We want lists to be immutable, but we don't want to force an implementation in the signature.
Consider using [this builder pattern](https://github.com/jclouds/jclouds-labs-openstack/blob/master/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java#L95-L115)
to make the builder produce immutable lists. The trick is to add getters that are only visible
to the builder itself but provide access to the actual list, so we can generate a proper immutable
one when building, regardless of the list the used passed when calling the public builder
methods.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/205/files#r40972128
Mime
View raw message