Implement sites list and copy result.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package com.lyndir.masterpassword.model;
|
||||
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import com.lyndir.masterpassword.*;
|
||||
import com.lyndir.masterpassword.model.impl.MPBasicSite;
|
||||
import com.lyndir.masterpassword.model.impl.MPBasicUser;
|
||||
@@ -94,7 +95,7 @@ public interface MPUser<S extends MPSite<?>> extends Comparable<MPUser<?>> {
|
||||
Collection<S> getSites();
|
||||
|
||||
@Nonnull
|
||||
Collection<S> findSites(String query);
|
||||
ImmutableCollection<S> findSites(String query);
|
||||
|
||||
boolean addListener(Listener listener);
|
||||
|
||||
|
@@ -20,6 +20,7 @@ package com.lyndir.masterpassword.model.impl;
|
||||
|
||||
import static com.lyndir.lhunath.opal.system.util.StringUtils.*;
|
||||
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.lyndir.lhunath.opal.system.CodeUtils;
|
||||
import com.lyndir.lhunath.opal.system.logging.Logger;
|
||||
@@ -172,7 +173,7 @@ public abstract class MPBasicUser<S extends MPBasicSite<?>> extends Changeable i
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Collection<S> findSites(final String query) {
|
||||
public ImmutableCollection<S> findSites(final String query) {
|
||||
ImmutableSortedSet.Builder<S> results = ImmutableSortedSet.naturalOrder();
|
||||
for (final S site : getSites())
|
||||
if (site.getName().startsWith( query ))
|
||||
|
Reference in New Issue
Block a user