1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty5.channel.kqueue;
17
18 import io.netty5.util.internal.UnstableApi;
19
20 import static java.util.Objects.requireNonNull;
21
22 @UnstableApi
23 public final class AcceptFilter {
24 static final AcceptFilter PLATFORM_UNSUPPORTED = new AcceptFilter("", "");
25 private final String filterName;
26 private final String filterArgs;
27
28 public AcceptFilter(String filterName, String filterArgs) {
29 this.filterName = requireNonNull(filterName, "filterName");
30 this.filterArgs = requireNonNull(filterArgs, "filterArgs");
31 }
32
33 public String filterName() {
34 return filterName;
35 }
36
37 public String filterArgs() {
38 return filterArgs;
39 }
40
41 @Override
42 public boolean equals(Object o) {
43 if (o == this) {
44 return true;
45 }
46 if (!(o instanceof AcceptFilter)) {
47 return false;
48 }
49 AcceptFilter rhs = (AcceptFilter) o;
50 return filterName.equals(rhs.filterName) && filterArgs.equals(rhs.filterArgs);
51 }
52
53 @Override
54 public int hashCode() {
55 return 31 * (31 + filterName.hashCode()) + filterArgs.hashCode();
56 }
57
58 @Override
59 public String toString() {
60 return filterName + ", " + filterArgs;
61 }
62 }