> +      Map<String, String> specValues = Splitter.on(';')
> +            .trimResults()
> +            .omitEmptyStrings()
> +            .withKeyValueSeparator('=')
> +            .split(hardwareSpec);
> +      if (!specValues.containsKey("ram") || 
> !specValues.containsKey("cores")) {
> +         throw new IllegalArgumentException(String.format("Omitted keys on 
> hardwareId: %s", hardwareId));
> +      }
> +      spec.ram = Integer.parseInt(specValues.get("ram"));
> +      spec.cores = Double.parseDouble(specValues.get("cores"));
> +      return spec;
> +   }
> +
> +   public static String generateAutomaticId(double cores, int ram) {
> +      return String.format("automatic:cores=%s;ram=%s", cores, ram);
> +   }

Consider overriding the `toString()` method instead of having this one.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/984/files/5e38477f80df5dd0dce54f7773cf9e883fbf3d2d#r71279090

Reply via email to