Add ability to show full WHOIS output in nomulus command

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197731992
This commit is contained in:
jianglai 2018-05-23 08:47:56 -07:00
parent ac500652ac
commit 86dd6bd59e
15 changed files with 181 additions and 62 deletions

View file

@ -134,24 +134,18 @@ abstract class WhoisResponseImpl implements WhoisResponse {
return emitField(Joiner.on(' ').join(nameParts), value);
}
/** Emit registrar address. */
E emitRegistrarAddress(@Nullable String prefix, @Nullable Address address) {
prefix = isNullOrEmpty(prefix) ? "" : prefix + " ";
if (address != null) {
emitList(prefix + "Street", address.getStreet());
emitField(prefix + "City", address.getCity());
emitField(prefix + "State/Province", address.getState());
emitField(prefix + "Postal Code", address.getZip());
emitField(prefix + "Country", address.getCountryCode());
}
return thisCastToDerived();
}
/** Emit registrant address. */
E emitRegistrantAddress(@Nullable String prefix, @Nullable Address address) {
/** Emit a contact address. */
E emitAddress(@Nullable String prefix, @Nullable Address address, boolean fullOutput) {
prefix = isNullOrEmpty(prefix) ? "" : prefix + " ";
if (address != null) {
if (fullOutput) {
emitList(prefix + "Street", address.getStreet());
emitField(prefix + "City", address.getCity());
}
emitField(prefix + "State/Province", address.getState());
if (fullOutput) {
emitField(prefix + "Postal Code", address.getZip());
}
emitField(prefix + "Country", address.getCountryCode());
}
return thisCastToDerived();