@Test public void newNameResolver() { assertSame(DnsNameResolver.class, provider.newNameResolver(URI.create("dns: assertNull( provider.newNameResolver(URI.create("notdns: }
@Override public DnsNameResolver newNameResolver(URI targetUri, Attributes params) { if (SCHEME.equals(targetUri.getScheme())) { String targetPath = Preconditions.checkNotNull(targetUri.getPath(), "targetPath"); Preconditions.checkArgument(targetPath.startsWith("/"), "the path component (%s) of the target (%s) must start with '/'", targetPath, targetUri); String name = targetPath.substring(1); return new DnsNameResolver( targetUri.getAuthority(), name, params, GrpcUtil.SHARED_CHANNEL_EXECUTOR, GrpcUtil.getDefaultProxyDetector(), Stopwatch.createUnstarted(), InternalServiceProviders.isAndroid(getClass().getClassLoader())); } else { return null; } }
DnsNameResolverProvider extends NameResolverProvider { @Override public DnsNameResolver newNameResolver(URI targetUri, Attributes params) { if (SCHEME.equals(targetUri.getScheme())) { String targetPath = Preconditions.checkNotNull(targetUri.getPath(), "targetPath"); Preconditions.checkArgument(targetPath.startsWith("/"), "the path component (%s) of the target (%s) must start with '/'", targetPath, targetUri); String name = targetPath.substring(1); return new DnsNameResolver( targetUri.getAuthority(), name, params, GrpcUtil.SHARED_CHANNEL_EXECUTOR, GrpcUtil.getDefaultProxyDetector(), Stopwatch.createUnstarted(), InternalServiceProviders.isAndroid(getClass().getClassLoader())); } else { return null; } } }
DnsNameResolverProvider extends NameResolverProvider { @Override public DnsNameResolver newNameResolver(URI targetUri, Attributes params) { if (SCHEME.equals(targetUri.getScheme())) { String targetPath = Preconditions.checkNotNull(targetUri.getPath(), "targetPath"); Preconditions.checkArgument(targetPath.startsWith("/"), "the path component (%s) of the target (%s) must start with '/'", targetPath, targetUri); String name = targetPath.substring(1); return new DnsNameResolver( targetUri.getAuthority(), name, params, GrpcUtil.SHARED_CHANNEL_EXECUTOR, GrpcUtil.getDefaultProxyDetector(), Stopwatch.createUnstarted(), InternalServiceProviders.isAndroid(getClass().getClassLoader())); } else { return null; } }  }
DnsNameResolverProvider extends NameResolverProvider { @Override public DnsNameResolver newNameResolver(URI targetUri, Attributes params) { if (SCHEME.equals(targetUri.getScheme())) { String targetPath = Preconditions.checkNotNull(targetUri.getPath(), "targetPath"); Preconditions.checkArgument(targetPath.startsWith("/"), "the path component (%s) of the target (%s) must start with '/'", targetPath, targetUri); String name = targetPath.substring(1); return new DnsNameResolver( targetUri.getAuthority(), name, params, GrpcUtil.SHARED_CHANNEL_EXECUTOR, GrpcUtil.getDefaultProxyDetector(), Stopwatch.createUnstarted(), InternalServiceProviders.isAndroid(getClass().getClassLoader())); } else { return null; } }  @Override DnsNameResolver newNameResolver(URI targetUri, Attributes params); @Override String getDefaultScheme(); }
DnsNameResolverProvider extends NameResolverProvider { @Override public DnsNameResolver newNameResolver(URI targetUri, Attributes params) { if (SCHEME.equals(targetUri.getScheme())) { String targetPath = Preconditions.checkNotNull(targetUri.getPath(), "targetPath"); Preconditions.checkArgument(targetPath.startsWith("/"), "the path component (%s) of the target (%s) must start with '/'", targetPath, targetUri); String name = targetPath.substring(1); return new DnsNameResolver( targetUri.getAuthority(), name, params, GrpcUtil.SHARED_CHANNEL_EXECUTOR, GrpcUtil.getDefaultProxyDetector(), Stopwatch.createUnstarted(), InternalServiceProviders.isAndroid(getClass().getClassLoader())); } else { return null; } }  @Override DnsNameResolver newNameResolver(URI targetUri, Attributes params); @Override String getDefaultScheme();  }