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

@@ -102,7 +102,7 @@ public class EventUtil {
AccountInfo accountInfo = new AccountInfo(account.getId().get());
accountInfo.email = account.getPreferredEmail();
accountInfo.name = account.getFullName();
accountInfo.username = accountState.getUserName();
accountInfo.username = accountState.getUserName().orElse(null);
return accountInfo;
}