mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 20:18:34 +02:00
Clean up some code quality issues
This removes some qualifiers that aren't necessary (e.g. public/abstract on interfaces, private on enum constructors, final on private methods, static on nested interfaces/enums), uses Java 8 lambdas and features where that's an improvement ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177182945
This commit is contained in:
parent
0935ba6450
commit
e2db3f914e
109 changed files with 286 additions and 379 deletions
|
@ -95,10 +95,10 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
|||
// is an abuse contact, we can get an email address from it.
|
||||
.emitFieldIfDefined(
|
||||
"Registrar Abuse Contact Email",
|
||||
abuseContact.isPresent() ? abuseContact.get().getEmailAddress() : null)
|
||||
abuseContact.map(RegistrarContact::getEmailAddress).orElse(null))
|
||||
.emitFieldIfDefined(
|
||||
"Registrar Abuse Contact Phone",
|
||||
abuseContact.isPresent() ? abuseContact.get().getPhoneNumber() : null)
|
||||
abuseContact.map(RegistrarContact::getPhoneNumber).orElse(null))
|
||||
.emitStatusValues(domain.getStatusValues(), domain.getGracePeriods())
|
||||
.emitContact("Registrant", domain.getRegistrant(), preferUnicode)
|
||||
.emitContact("Admin", getContactReference(Type.ADMIN), preferUnicode)
|
||||
|
@ -123,7 +123,7 @@ final class DomainWhoisResponse extends WhoisResponseImpl {
|
|||
private Key<ContactResource> getContactReference(final Type type) {
|
||||
Optional<DesignatedContact> contactOfType =
|
||||
domain.getContacts().stream().filter(d -> d.getType() == type).findFirst();
|
||||
return contactOfType.isPresent() ? contactOfType.get().getContactKey() : null;
|
||||
return contactOfType.map(DesignatedContact::getContactKey).orElse(null);
|
||||
}
|
||||
|
||||
/** Output emitter with logic for domains. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue