> +public abstract class CreateAccount {
> +
> + public abstract String username();
> +
> + public abstract String password();
> +
> + public abstract CreateRole role();
> +
> + CreateAccount() {
> + }
> +
> + @SerializedNames({ "username", "password", "role"})
> + public static CreateAccount create(String username, String password,
> CreateRole role) {
> + checkArgument(username.length() > 0, "username must not be empty
> string");
> + checkArgument(password.length() > 0, "password must not be empty
> string");
> + if (role == null) role = CreateRole.create("user");
Instead of doing this I'dd add two factory methods, one with the role and one
without it.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/165/files#r28409331