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