> +   public int hashCode() {
> +      return Objects.hashCode(userId, name, resourceId, source, meterId, 
> projectId, type, unit);
> +   }
> +
> +   protected Objects.ToStringHelper string() {
> +      return Objects.toStringHelper(this)
> +            .add("userId", userId).add("name", name).add("resourceId", 
> resourceId).add("source", source).add("meterId", meterId)
> +            .add("projectId", projectId).add("type", type).add("unit", unit);
> +   }
> +
> +   @Override
> +   public String toString() {
> +      return string().toString();
> +   }
> +
> +}

To give you an idea of how simple AutoValue would be for the Meter class (minus 
the builder code), we would end up with a class similar to the following:
```
@AutoValue
abstract class Meter {
  
   Meter() {}

   @SerializedNames({"user_id", "name", "resource_id", "source", "meter_id", 
"project_id", type, unit})
   public static Meter create(String userId, String name, String resourceId, 
String source, String meterId, String projectId, String type, String unit) {
      return new AutoValue_Meter(userId, name, resourceId, source, meterId, 
projectId, type, unit);
   }   

   abstract String userId();
   abstract String name();   
   abstract String resourceId();
   abstract String source();
   abstract String meterId();
   abstract String projectId();
   abstract String type();
   abstract String unit();
}
```
Oh, isn't that so nice! ;) 

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

Reply via email to