@Override public Password get(Object key) { // Make it compatible with the old way (low-efficient) if (key instanceof String && !((String) key).contains(":")) { return getByUsername((String) key); } return super.get(key); }
@Override public boolean containsKey(Object key) { if (key instanceof String && !((String) key).contains(":")) { return getByUsername((String) key) != null; } return super.containsKey(key); }
@Override public Password remove(String key) { // Make it compatible with the old way (low-efficient) if (!key.contains(":")) { Password password = getByUsername((String) key); validate(); if (password == null) return null; password.remove(); // by invalidating any access to items will get refreshed invalidate(); return password; } return super.remove(key); }