1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.resolver.dns;
17
18
19
20
21 final class UnixResolverOptions {
22
23 private final int ndots;
24 private final int timeout;
25 private final int attempts;
26
27 UnixResolverOptions(int ndots, int timeout, int attempts) {
28 this.ndots = ndots;
29 this.timeout = timeout;
30 this.attempts = attempts;
31 }
32
33 static UnixResolverOptions.Builder newBuilder() {
34 return new UnixResolverOptions.Builder();
35 }
36
37
38
39
40
41 int ndots() {
42 return ndots;
43 }
44
45
46
47
48
49 int timeout() {
50 return timeout;
51 }
52
53
54
55
56
57 int attempts() {
58 return attempts;
59 }
60
61 @Override
62 public String toString() {
63 return getClass().getSimpleName() +
64 "{ndots=" + ndots +
65 ", timeout=" + timeout +
66 ", attempts=" + attempts +
67 '}';
68 }
69
70 static final class Builder {
71
72 private int ndots = 1;
73 private int timeout = 5;
74 private int attempts = 16;
75
76 private Builder() {
77 }
78
79 void setNdots(int ndots) {
80 this.ndots = ndots;
81 }
82
83 void setTimeout(int timeout) {
84 this.timeout = timeout;
85 }
86
87 void setAttempts(int attempts) {
88 this.attempts = attempts;
89 }
90
91 UnixResolverOptions build() {
92 return new UnixResolverOptions(ndots, timeout, attempts);
93 }
94 }
95 }