mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
Add additional return values to PricingEngine interface
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=123658519
This commit is contained in:
parent
ca585dd0b5
commit
91f6c7006e
21 changed files with 191 additions and 191 deletions
|
@ -43,7 +43,10 @@ public final class DomainNameUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the canonicalized TLD part of a valid domain name by stripping off the leftmost part.
|
||||
* Returns the canonicalized TLD part of a valid fully-qualified domain name by stripping off the
|
||||
* leftmost part.
|
||||
*
|
||||
* <p>This method should not be called for subdomains.
|
||||
*
|
||||
* <p>This function is compatible with multi-part tlds, e.g. {@code co.uk}. This function will
|
||||
* also work on domains for which the registry is not authoritative. If you are certain that the
|
||||
|
@ -51,28 +54,28 @@ public final class DomainNameUtils {
|
|||
* {@link google.registry.model.registry.Registries#findTldForName(InternetDomainName)
|
||||
* Registries#findTldForName}, which will work on hostnames in addition to domains.
|
||||
*
|
||||
* @param fullyQualifiedDomainName must be a puny-coded domain name (not a subdomain or Unicode)
|
||||
* @param fullyQualifiedDomainName must be a punycode SLD (not a host or unicode)
|
||||
* @throws IllegalArgumentException if there is no TLD
|
||||
*/
|
||||
public static String getTldFromDomainName(String fullyQualifiedDomainName) {
|
||||
checkArgument(
|
||||
!Strings.isNullOrEmpty(fullyQualifiedDomainName),
|
||||
"fullyQualifiedDomainName cannot be null or empty");
|
||||
"secondLevelDomainName cannot be null or empty");
|
||||
return getTldFromDomainName(InternetDomainName.from(fullyQualifiedDomainName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the canonicalized TLD part of a valid domain name by stripping off the leftmost part.
|
||||
* Returns the canonicalized TLD part of a valid fully-qualified domain name by stripping off the
|
||||
* leftmost part.
|
||||
*
|
||||
* <p>This function is compatible with multi-part TLDs and must not be called with subdomains.
|
||||
* <p>This function is compatible with multi-part TLDs and should not be called with subdomains.
|
||||
*
|
||||
* @throws IllegalArgumentException if there is no TLD
|
||||
*/
|
||||
public static String getTldFromDomainName(InternetDomainName fullyQualifiedDomainName) {
|
||||
checkArgumentNotNull(fullyQualifiedDomainName);
|
||||
checkArgument(
|
||||
fullyQualifiedDomainName.hasParent(), "fullyQualifiedDomainName does not have a TLD");
|
||||
return fullyQualifiedDomainName.parent().toString();
|
||||
public static String getTldFromDomainName(InternetDomainName domainName) {
|
||||
checkArgumentNotNull(domainName);
|
||||
checkArgument(domainName.hasParent(), "secondLevelDomainName does not have a TLD");
|
||||
return domainName.parent().toString();
|
||||
}
|
||||
|
||||
private DomainNameUtils() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue