diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 15:26:35 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 15:26:35 +0100 |
commit | 114888857c816fb87d52bb703703c38021366f2e (patch) | |
tree | 1c26c5c009747d17868ed2e21d47af4e04ced2a6 /main/src/cgeo/geocaching/connector/ConnectorFactory.java | |
parent | e89da5864a49b4b0f05b0c2a9f62c2ffae8cafa8 (diff) | |
download | cgeo-114888857c816fb87d52bb703703c38021366f2e.zip cgeo-114888857c816fb87d52bb703703c38021366f2e.tar.gz cgeo-114888857c816fb87d52bb703703c38021366f2e.tar.bz2 |
refactoring: make search by owner/finder connector capabilities
Diffstat (limited to 'main/src/cgeo/geocaching/connector/ConnectorFactory.java')
-rw-r--r-- | main/src/cgeo/geocaching/connector/ConnectorFactory.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/connector/ConnectorFactory.java b/main/src/cgeo/geocaching/connector/ConnectorFactory.java index 41e4e37..0081951 100644 --- a/main/src/cgeo/geocaching/connector/ConnectorFactory.java +++ b/main/src/cgeo/geocaching/connector/ConnectorFactory.java @@ -6,7 +6,9 @@ import cgeo.geocaching.SearchResult; import cgeo.geocaching.Trackable; import cgeo.geocaching.connector.capability.ILogin; import cgeo.geocaching.connector.capability.ISearchByCenter; +import cgeo.geocaching.connector.capability.ISearchByFinder; import cgeo.geocaching.connector.capability.ISearchByKeyword; +import cgeo.geocaching.connector.capability.ISearchByOwner; import cgeo.geocaching.connector.capability.ISearchByViewPort; import cgeo.geocaching.connector.ec.ECConnector; import cgeo.geocaching.connector.gc.GCConnector; @@ -71,6 +73,10 @@ public final class ConnectorFactory { private static final Collection<ISearchByKeyword> searchByKeywordConns = getMatchingConnectors(ISearchByKeyword.class); + private static final Collection<ISearchByOwner> SEARCH_BY_OWNER_CONNECTORS = getMatchingConnectors(ISearchByOwner.class); + + private static final Collection<ISearchByFinder> SEARCH_BY_FINDER_CONNECTORS = getMatchingConnectors(ISearchByFinder.class); + @SuppressWarnings("unchecked") private static <T extends IConnector> Collection<T> getMatchingConnectors(final Class<T> clazz) { final List<T> matching = new ArrayList<T>(); @@ -94,6 +100,14 @@ public final class ConnectorFactory { return searchByKeywordConns; } + public static Collection<ISearchByOwner> getSearchByOwnerConnectors() { + return SEARCH_BY_OWNER_CONNECTORS; + } + + public static Collection<ISearchByFinder> getSearchByFinderConnectors() { + return SEARCH_BY_FINDER_CONNECTORS; + } + public static ILogin[] getActiveLiveConnectors() { final List<ILogin> liveConns = new ArrayList<ILogin>(); for (final IConnector conn : CONNECTORS) { |