View Javadoc

1   /**
2    * LOGBack: the reliable, fast and flexible logging library for Java.
3    * 
4    * Copyright (C) 1999-2006, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.core.pattern.parser;
11  
12  import ch.qos.logback.core.pattern.FormatInfo;
13  
14  public class FormattingNode extends Node {
15  
16    FormatInfo formatInfo;
17  
18    FormattingNode(int type) {
19      super(type);
20    }
21  
22    FormattingNode(int type, Object value) {
23      super(type, value);
24    }
25  
26    public FormatInfo getFormatInfo() {
27      return formatInfo;
28    }
29  
30    public void setFormatInfo(FormatInfo formatInfo) {
31      this.formatInfo = formatInfo;
32    }
33  
34    public boolean equals(Object o) {
35      if (!super.equals(o)) {
36        return false;
37      }
38  
39      if(!(o instanceof FormattingNode)) {
40          return false;
41      }
42      FormattingNode r = (FormattingNode) o;
43  
44      return (formatInfo != null ? formatInfo.equals(r.formatInfo)
45          : r.formatInfo == null);
46    }
47  }