AccountCache: Remove unused getIfPresent
Change-Id: Id5689dc5a42de257915e960a46cfaca080dff06f Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -42,16 +42,6 @@ public interface AccountCache {
|
||||
@Nullable
|
||||
AccountState getOrNull(Account.Id accountId);
|
||||
|
||||
/**
|
||||
* Returns an {@code AccountState} instance for the given account ID if it is present in the
|
||||
* cache.
|
||||
*
|
||||
* @param accountId ID of the account that should be retrieved
|
||||
* @return {@code AccountState} instance for the given account ID if it is present in the cache,
|
||||
* otherwise {@code null}
|
||||
*/
|
||||
AccountState getIfPresent(Account.Id accountId);
|
||||
|
||||
AccountState getByUsername(String username);
|
||||
|
||||
void evict(Account.Id accountId) throws IOException;
|
||||
|
||||
@@ -110,12 +110,6 @@ public class AccountCacheImpl implements AccountCache {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountState getIfPresent(Account.Id accountId) {
|
||||
Optional<AccountState> state = byId.getIfPresent(accountId);
|
||||
return state != null ? state.orElse(missing(accountId)) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountState getByUsername(String username) {
|
||||
try {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class FakeAccountCache implements AccountCache {
|
||||
|
||||
@Override
|
||||
public synchronized AccountState get(Account.Id accountId) {
|
||||
AccountState state = getIfPresent(accountId);
|
||||
AccountState state = byId.get(accountId);
|
||||
if (state != null) {
|
||||
return state;
|
||||
}
|
||||
@@ -48,11 +48,6 @@ public class FakeAccountCache implements AccountCache {
|
||||
return byId.get(accountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized AccountState getIfPresent(Account.Id accountId) {
|
||||
return byId.get(accountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized AccountState getByUsername(String username) {
|
||||
return byUsername.get(username);
|
||||
|
||||
Reference in New Issue
Block a user