Merge "AddKeySender: Make all methods private which are only within the class"

This commit is contained in:
David Pursehouse
2019-12-15 08:27:23 +00:00
committed by Gerrit Code Review

View File

@@ -79,15 +79,26 @@ public class AddKeySender extends OutgoingEmail {
} }
} }
public String getEmail() { @Override
protected void setupSoyContext() {
super.setupSoyContext();
soyContextEmailData.put("email", getEmail());
soyContextEmailData.put("gpgKeys", getGpgKeys());
soyContextEmailData.put("keyType", getKeyType());
soyContextEmailData.put("sshKey", getSshKey());
soyContextEmailData.put("userNameEmail", getUserNameEmailFor(user.getAccountId()));
}
@Override
protected boolean supportsHtml() {
return true;
}
private String getEmail() {
return user.getAccount().preferredEmail(); return user.getAccount().preferredEmail();
} }
public String getUserNameEmail() { private String getKeyType() {
return getUserNameEmailFor(user.getAccountId());
}
public String getKeyType() {
if (sshKey != null) { if (sshKey != null) {
return "SSH"; return "SSH";
} else if (gpgKeys != null) { } else if (gpgKeys != null) {
@@ -96,29 +107,14 @@ public class AddKeySender extends OutgoingEmail {
return "Unknown"; return "Unknown";
} }
public String getSshKey() { private String getSshKey() {
return (sshKey != null) ? sshKey.sshPublicKey() + "\n" : null; return (sshKey != null) ? sshKey.sshPublicKey() + "\n" : null;
} }
public String getGpgKeys() { private String getGpgKeys() {
if (gpgKeys != null) { if (gpgKeys != null) {
return Joiner.on("\n").join(gpgKeys); return Joiner.on("\n").join(gpgKeys);
} }
return null; return null;
} }
@Override
protected void setupSoyContext() {
super.setupSoyContext();
soyContextEmailData.put("email", getEmail());
soyContextEmailData.put("gpgKeys", getGpgKeys());
soyContextEmailData.put("keyType", getKeyType());
soyContextEmailData.put("sshKey", getSshKey());
soyContextEmailData.put("userNameEmail", getUserNameEmail());
}
@Override
protected boolean supportsHtml() {
return true;
}
} }