AccountState#getUserName: Return Optional<String> instead of nullable String

This makes it more explicit that callers must handle the case where the
returned username is absent.

Change-Id: I01d2e3fd32726db6175c157bc71a551d35b4803f
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2018-01-18 18:09:34 +01:00
parent b820248633
commit 9cb0b0cb88
18 changed files with 45 additions and 43 deletions

View File

@@ -590,7 +590,7 @@ public class EventFactory {
AccountAttribute who = new AccountAttribute();
who.name = accountState.getAccount().getFullName();
who.email = accountState.getAccount().getPreferredEmail();
who.username = accountState.getUserName();
who.username = accountState.getUserName().orElse(null);
return who;
}