1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.classic.model;
15
16 import java.util.Objects;
17
18 import ch.qos.logback.core.model.Model;
19 import ch.qos.logback.core.model.processor.PhaseIndicator;
20 import ch.qos.logback.core.model.processor.ProcessingPhase;
21
22 @PhaseIndicator(phase = ProcessingPhase.SECOND)
23 public class RootLoggerModel extends Model {
24
25 private static final long serialVersionUID = -2811453129653502831L;
26 String level;
27
28 @Override
29 protected RootLoggerModel makeNewInstance() {
30 return new RootLoggerModel();
31 }
32
33 @Override
34 protected void mirror(Model that) {
35 RootLoggerModel actual = (RootLoggerModel) that;
36 super.mirror(actual);
37 this.level = actual.level;
38 }
39
40
41 public String getLevel() {
42 return level;
43 }
44
45 public void setLevel(String level) {
46 this.level = level;
47 }
48
49 @Override
50 public int hashCode() {
51 final int prime = 31;
52 int result = super.hashCode();
53 result = prime * result + Objects.hash(level);
54 return result;
55 }
56
57 @Override
58 public boolean equals(Object obj) {
59 if (this == obj)
60 return true;
61 if (!super.equals(obj))
62 return false;
63 if (getClass() != obj.getClass())
64 return false;
65 RootLoggerModel other = (RootLoggerModel) obj;
66 return Objects.equals(level, other.level);
67 }
68
69
70 }