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-openstack] Poppy service api (#179)
Date Fri, 06 Mar 2015 21:56:27 GMT
> +import org.jclouds.json.SerializedNames;
> +
> +import com.google.auto.value.AutoValue;
> +
> +/**
> + * Representation of an OpenStack Poppy Caching Rule.
> + */
> +@AutoValue
> +public abstract class Caching {
> +   public abstract String getName();
> +   public abstract int getTtl();
> +   @Nullable public abstract List<CachingRule> getRules();
> +
> +   @SerializedNames({ "name", "ttl", "rules" })
> +   private static Caching create(String name, int ttl, List<CachingRule> rules)
{
> +      return builder().name(name).ttl(ttl).rules(rules).build();

To enforce immutability also in lists use `ImmutableList.copyOf` when the list is not null.

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