1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty5.bootstrap;
17
18 import io.netty5.channel.Channel;
19 import io.netty5.channel.ChannelFactory;
20 import io.netty5.resolver.AddressResolverGroup;
21
22 import java.net.SocketAddress;
23
24
25
26
27 public final class BootstrapConfig extends
28 AbstractBootstrapConfig<Bootstrap, Channel, ChannelFactory<? extends Channel>> {
29
30 BootstrapConfig(Bootstrap bootstrap) {
31 super(bootstrap);
32 }
33
34 @Override
35 public ChannelFactory<? extends Channel> channelFactory() {
36 return bootstrap.channelFactory;
37 }
38
39
40
41
42 public SocketAddress remoteAddress() {
43 return bootstrap.remoteAddress();
44 }
45
46
47
48
49 public AddressResolverGroup<?> resolver() {
50 return bootstrap.resolver();
51 }
52
53 @Override
54 public String toString() {
55 StringBuilder buf = new StringBuilder(super.toString());
56 buf.setLength(buf.length() - 1);
57 buf.append(", resolver: ").append(resolver());
58 SocketAddress remoteAddress = remoteAddress();
59 if (remoteAddress != null) {
60 buf.append(", remoteAddress: ")
61 .append(remoteAddress);
62 }
63 return buf.append(')').toString();
64 }
65 }