@Test public void testOverrideBundledProviderProtocols() { final TestProtocol baseProtocol = new TestProtocol(Scheme.http); final TestProtocol overrideProtocol = new TestProtocol(Scheme.http) { @Override public String getProvider() { return "test-provider"; } @Override public boolean isBundled() { return false; } }; final ProtocolFactory f = new ProtocolFactory(Stream.of(baseProtocol, overrideProtocol).collect(Collectors.toSet())); assertEquals(baseProtocol, f.forName("test")); assertEquals(overrideProtocol, f.forName("test", "test-provider")); }
public Protocol forName(final String identifier) { return this.forName(identifier, null); }
ProtocolFactory { public Protocol forName(final String identifier) { return this.forName(identifier, null); } }
ProtocolFactory { public Protocol forName(final String identifier) { return this.forName(identifier, null); } ProtocolFactory();  ProtocolFactory(final Set<Protocol> protocols);  ProtocolFactory(final Local bundle, final Set<Protocol> protocols); }
ProtocolFactory { public Protocol forName(final String identifier) { return this.forName(identifier, null); } ProtocolFactory();  ProtocolFactory(final Set<Protocol> protocols);  ProtocolFactory(final Local bundle, final Set<Protocol> protocols); static ProtocolFactory get(); void register(Protocol... protocols); void loadDefaultProfiles(); void register(final Protocol protocol); List<Protocol> find(); List<Protocol> find(final Predicate<Protocol> search); Protocol forName(final String identifier); Protocol forName(final String identifier, final String provider); Protocol forName(final List<Protocol> enabled, final String identifier, final String provider); Protocol forType(final Protocol.Type type); Protocol forScheme(final Scheme scheme); Protocol forScheme(final String scheme, final Protocol fallback); @Override String toString(); }
ProtocolFactory { public Protocol forName(final String identifier) { return this.forName(identifier, null); } ProtocolFactory();  ProtocolFactory(final Set<Protocol> protocols);  ProtocolFactory(final Local bundle, final Set<Protocol> protocols); static ProtocolFactory get(); void register(Protocol... protocols); void loadDefaultProfiles(); void register(final Protocol protocol); List<Protocol> find(); List<Protocol> find(final Predicate<Protocol> search); Protocol forName(final String identifier); Protocol forName(final String identifier, final String provider); Protocol forName(final List<Protocol> enabled, final String identifier, final String provider); Protocol forType(final Protocol.Type type); Protocol forScheme(final Scheme scheme); Protocol forScheme(final String scheme, final Protocol fallback); @Override String toString();  }