> +      this.state = state;
> +      return this;
> +      }
> +
> +      public Builder location(Location location) {
> +      this.location = location;
> +      return this;
> +      }
> +
> +      public Builder version(int version) {
> +      this.version = version;
> +      return this;
> +      }
> +
> +      public DataCenter build() {
> +      return DataCenter.create(id, name, version, state, location);

Hmm. Won't that be a little redundant, since there are already null-checks on 
the autovalue-generated constructor? Like, creating via builder e.g: with only 
<i>name</i> present throws:

<pre>
java.lang.NullPointerException: Null id
        at 
org.jclouds.profitbricks.domain.AutoValue_DataCenter.<init>(AutoValue_DataCenter.java:22)
        at org.jclouds.profitbricks.domain.DataCenter.create(DataCenter.java:40)
        at 
org.jclouds.profitbricks.domain.DataCenter$Builder.build(DataCenter.java:88)
        at 
org.jclouds.profitbricks.binder.datacenter.CreateDataCenterRequestBinderTest.testCreatePayload(CreateDataCenterRequestBinderTest.java:33)
</pre>

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r22242141

Reply via email to