You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Adrian Cole <no...@github.com> on 2014/10/25 06:14:26 UTC

[jclouds-labs] Use google auto to save the day (#100)

Thanks to @eamonnmcmanus and @cgruber AutoValue (and also AutoService) are here to save us from writing tons of toStringHelpers, and from thrashing on guava versions of that. You&#39;ll notice that after using auto-value, these types are far easier to read. Whooot!
You can merge this Pull Request by running:

  git pull https://github.com/adriancole/jclouds-labs adrian.auto-azure

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-labs/pull/100

-- Commit Summary --

  * JCLOUDS-750 use AutoService to replace error-prone ProviderMetadata manifests.
  * JCLOUDS-750  Use AutoValue to decruft value types and remove guava dependency from them.

-- File Changes --

    M azurecompute/README.md (3)
    M azurecompute/pom.xml (6)
    M azurecompute/src/main/java/org/jclouds/azurecompute/AzureComputeProviderMetadata.java (6)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/CloudService.java (114)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/Deployment.java (137)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/DeploymentParams.java (169)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/Disk.java (175)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/Error.java (53)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/Location.java (63)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImage.java (120)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/OSImageParams.java (67)
    M azurecompute/src/main/java/org/jclouds/azurecompute/domain/Operation.java (68)
    D azurecompute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata (1)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/100.patch
https://github.com/jclouds/jclouds-labs/pull/100.diff

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

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Jeremy Daggett <no...@github.com>.
@adriancole Have you figured out a way to map snakeycase fields like `availability_zone` to `availabilityZone`?? That is what I was stuck on in my prototyping with AutoValue. If there is a solution for this mapping, I would really like to know!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60494153

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by BuildHive <no...@github.com>.
[jclouds ยป jclouds-labs #1780](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs/1780/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60471260

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-pull-requests #348](https://jclouds.ci.cloudbees.com/job/jclouds-labs-pull-requests/348/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60471112

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Adrian Cole <no...@github.com>.
also, since auto generates subtypes, any gson type adapters will need to be converted to type adapter factories. Ex. via subclassing this https://github.com/jclouds/jclouds-labs-google/pull/67/files#diff-18

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60502162

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Andrea Turli <no...@github.com>.
Interesting approach! I'd like to see it more adopted in jclouds later

+1

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60492666

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Adrian Cole <no...@github.com>.
irc, latest rc of auto propagates annotations like SerializedName. Give it
a shot!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60494982

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Adrian Cole <no...@github.com>.
Ah. so it actually only propagates the method annotations. This works
for jackson, but not gson, as gson @SerializedName is on fields. Now
remember that if your api is consistent, all you need to do is
configure the global gson to use snake case. that avoids this issue
completely.

ex. gsonBuilder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60499150

Re: [jclouds-labs] Use google auto to save the day (#100)

Posted by Adrian Cole <no...@github.com>.
picked into 1.8.x and master

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/100#issuecomment-60492858