1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.core.pattern.parser;
15
16 import ch.qos.logback.core.pattern.FormatInfo;
17
18 public class FormattingNode extends Node {
19
20 FormatInfo formatInfo;
21
22 FormattingNode(int type) {
23 super(type);
24 }
25
26 FormattingNode(int type, Object value) {
27 super(type, value);
28 }
29
30 public FormatInfo getFormatInfo() {
31 return formatInfo;
32 }
33
34 public void setFormatInfo(FormatInfo formatInfo) {
35 this.formatInfo = formatInfo;
36 }
37
38 public boolean equals(Object o) {
39 if (!super.equals(o)) {
40 return false;
41 }
42
43 if (!(o instanceof FormattingNode)) {
44 return false;
45 }
46 FormattingNode r = (FormattingNode) o;
47
48 return (formatInfo != null ? formatInfo.equals(r.formatInfo) : r.formatInfo == null);
49 }
50
51 @Override
52 public int hashCode() {
53 int result = super.hashCode();
54 result = 31 * result + (formatInfo != null ? formatInfo.hashCode() : 0);
55 return result;
56 }
57 }