mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Add set of valid TLDs to LrpToken
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=129141577
This commit is contained in:
parent
eb76b063b3
commit
d2ca1ff691
1 changed files with 17 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.model.domain;
|
||||
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
|
@ -25,6 +26,8 @@ import google.registry.model.Buildable;
|
|||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.Type;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* An entity representing a token distributed to eligible LRP registrants.
|
||||
*/
|
||||
|
@ -43,6 +46,11 @@ public class LrpToken extends BackupGroupRoot implements Buildable {
|
|||
@Index
|
||||
String token;
|
||||
|
||||
/**
|
||||
* A list of TLDs for which this LRP token is valid.
|
||||
*/
|
||||
Set<String> validTlds;
|
||||
|
||||
/**
|
||||
* The key of the history entry for which the token was used. Given LRP is a domain application
|
||||
* phase, this should always be a {@link Type#DOMAIN_APPLICATION_CREATE}.
|
||||
|
@ -65,6 +73,10 @@ public class LrpToken extends BackupGroupRoot implements Buildable {
|
|||
return redemptionHistoryEntry != null;
|
||||
}
|
||||
|
||||
public Set<String> getValidTlds() {
|
||||
return nullToEmptyImmutableCopy(validTlds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder asBuilder() {
|
||||
return new Builder(clone(this));
|
||||
|
@ -92,5 +104,10 @@ public class LrpToken extends BackupGroupRoot implements Buildable {
|
|||
getInstance().redemptionHistoryEntry = checkArgumentNotNull(redemptionHistoryEntry);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setValidTlds(Set<String> validTlds) {
|
||||
getInstance().validTlds = validTlds;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue