mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Add command for creating LRP tokens
Command allows for both one-off creation and bulk import of assignees via file (the latter will be used for the initial import from Play Store). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133048360
This commit is contained in:
parent
1a050554fe
commit
75203918a9
7 changed files with 404 additions and 5 deletions
|
@ -17,6 +17,10 @@ package google.registry.tools;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/** String generator. */
|
||||
abstract class StringGenerator {
|
||||
|
||||
|
@ -41,4 +45,13 @@ abstract class StringGenerator {
|
|||
|
||||
/** Generates a string of a specified length. */
|
||||
abstract String createString(int length);
|
||||
|
||||
/** Batch-generates an {@link ImmutableList} of strings of a specified length. */
|
||||
public Collection<String> createStrings(int length, int count) {
|
||||
ImmutableList.Builder<String> listBuilder = new ImmutableList.Builder<>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
listBuilder.add(createString(length));
|
||||
}
|
||||
return listBuilder.build();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue