mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
Add assertTldsExist(Iterable<String>) to check multiple TLDs at once
This is better than calling assertTldExists() inside a for loop because you can throw a single exception reporting all bad TLDs at once rather than only getting as far as the first failure. And then it's also a one-liner instead of 3 lines. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152412876
This commit is contained in:
parent
783033c261
commit
5081d780dc
8 changed files with 31 additions and 28 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static google.registry.model.registry.Registries.assertTldExists;
|
||||
import static google.registry.model.registry.Registries.assertTldsExist;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
@ -33,8 +33,8 @@ final class GetTldCommand implements RemoteApiCommand {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
for (String tld : mainParameters) {
|
||||
System.out.println(Registry.get(assertTldExists(tld)));
|
||||
for (String tld : assertTldsExist(mainParameters)) {
|
||||
System.out.println(Registry.get(tld));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue