1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.spf4j.test.log;
17
18 import java.util.Objects;
19 import org.spf4j.log.Level;
20
21
22
23
24 public final class PrintConfig {
25
26
27
28
29 private final String category;
30
31
32
33 private final boolean greedy;
34
35
36
37 private final Level minLevel;
38
39 public PrintConfig(final String category, final Level minLevel, final boolean greedy) {
40 this.category = category;
41 this.greedy = greedy;
42 this.minLevel = minLevel;
43 }
44
45 public String getCategory() {
46 return category;
47 }
48
49 public boolean isGreedy() {
50 return greedy;
51 }
52
53 public Level getMinLevel() {
54 return minLevel;
55 }
56
57 @Override
58 public int hashCode() {
59 int hash = 11 + Objects.hashCode(this.category);
60 hash = 11 * hash + (this.greedy ? 1 : 0);
61 return 11 * hash + Objects.hashCode(this.minLevel);
62 }
63
64 @Override
65 public boolean equals(final Object obj) {
66 if (this == obj) {
67 return true;
68 }
69 if (obj == null) {
70 return false;
71 }
72 if (getClass() != obj.getClass()) {
73 return false;
74 }
75 final PrintConfig other = (PrintConfig) obj;
76 if (this.greedy != other.greedy) {
77 return false;
78 }
79 if (!Objects.equals(this.category, other.category)) {
80 return false;
81 }
82 return this.minLevel == other.minLevel;
83 }
84
85
86
87 @Override
88 public String toString() {
89 return "PrintConfig{" + "category=" + category + ", greedy=" + greedy + ", minLevel=" + minLevel + '}';
90 }
91
92
93
94 }