@Override protected Account buildAccount(String accountName) { GoogleAccount account = (GoogleAccount) new GoogleAccount().setName(accountName); account = (GoogleAccount) account.setJsonPath(jsonPath) .setProject(project); account.setAlphaListed(alphaListed) .setImageProjects(imageProjects) .setUserDataFile(userDataFile) .setRegions(regions); return account; }
@Override protected Account buildAccount(String accountName) { GoogleAccount account = (GoogleAccount) new GoogleAccount().setName(accountName); account = (GoogleAccount) account.setJsonPath(jsonPath) .setProject(project); account.setAlphaListed(alphaListed) .setImageProjects(imageProjects) .setUserDataFile(userDataFile) .setRegions(regions); return account; }
@Override protected Account editAccount(GoogleAccount account) { account.setJsonPath(isSet(jsonPath) ? jsonPath : account.getJsonPath()); account.setProject(isSet(project) ? project : account.getProject()); account.setAlphaListed(alphaListed != null ? alphaListed : account.isAlphaListed()); try { account.setImageProjects( updateStringList(account.getImageProjects(), imageProjects, addImageProject, removeImageProject)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --image-projects or --[add/remove]-image-project"); } try { account.setRegions( updateStringList(account.getRegions(), regions, addRegion, removeRegion)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --regions or --[add/remove]-region"); } return account; } }
@Override protected Account editAccount(GoogleAccount account) { account.setJsonPath(isSet(jsonPath) ? jsonPath : account.getJsonPath()); account.setProject(isSet(project) ? project : account.getProject()); account.setAlphaListed(alphaListed != null ? alphaListed : account.isAlphaListed()); account.setUserDataFile(userDataFile != null ? userDataFile : account.getUserDataFile()); try { account.setImageProjects( updateStringList(account.getImageProjects(), imageProjects, addImageProject, removeImageProject)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --image-projects or --[add/remove]-image-project"); } try { account.setRegions( updateStringList(account.getRegions(), regions, addRegion, removeRegion)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Set either --regions or --[add/remove]-region"); } return account; } }