mirror of
https://github.com/google/nomulus.git
synced 2025-07-17 00:06:04 +02:00
Make loadByForeignKeyCached() return an Optional type
Next up (and a much larger commit) will be giving loadByForeignKey() the same treatment. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225182377
This commit is contained in:
parent
400994237c
commit
015c854a92
4 changed files with 18 additions and 21 deletions
|
@ -33,9 +33,7 @@ public class DomainLookupCommand extends DomainOrHostLookupCommand {
|
|||
|
||||
@Override
|
||||
protected Optional<WhoisResponse> getResponse(InternetDomainName domainName, DateTime now) {
|
||||
final DomainResource domainResource =
|
||||
loadByForeignKeyCached(DomainResource.class, domainName.toString(), now);
|
||||
return Optional.ofNullable(
|
||||
domainResource == null ? null : new DomainWhoisResponse(domainResource, fullOutput, now));
|
||||
return loadByForeignKeyCached(DomainResource.class, domainName.toString(), now)
|
||||
.map(domain -> new DomainWhoisResponse(domain, fullOutput, now));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue