mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Simplify logic in create/update tld commands
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=121993554
This commit is contained in:
parent
d1f34776d2
commit
d62da7bb19
3 changed files with 102 additions and 95 deletions
|
@ -17,9 +17,11 @@ package google.registry.tools;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.model.registry.Registries.getTlds;
|
||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
@ -81,4 +83,19 @@ class CreateTldCommand extends CreateOrUpdateTldCommand {
|
|||
checkState(!getTlds().contains(tld), "TLD already exists");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
ImmutableSet<String> getAllowedRegistrants(Registry oldRegistry) {
|
||||
return ImmutableSet.copyOf(nullToEmpty(allowedRegistrants));
|
||||
}
|
||||
|
||||
@Override
|
||||
ImmutableSet<String> getAllowedNameservers(Registry oldRegistry) {
|
||||
return ImmutableSet.copyOf(nullToEmpty(allowedNameservers));
|
||||
}
|
||||
|
||||
@Override
|
||||
ImmutableSet<String> getReservedLists(Registry oldRegistry) {
|
||||
return ImmutableSet.copyOf(nullToEmpty(reservedListNames));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue