View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2021, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.model;
15  
16  import java.util.Objects;
17  
18  import ch.qos.logback.core.model.processor.PhaseIndicator;
19  import ch.qos.logback.core.model.processor.ProcessingPhase;
20  
21  @PhaseIndicator(phase = ProcessingPhase.SECOND)
22  public class AppenderRefModel extends Model {
23  
24      private static final long serialVersionUID = 5238705468395447547L;
25  
26      String ref;
27  
28      protected AppenderRefModel makeNewInstance() {
29          return new AppenderRefModel();
30      }
31      
32      @Override
33      protected void mirror(Model that) {
34          AppenderRefModel actual = (AppenderRefModel) that;
35          super.mirror(actual);
36          this.ref = actual.ref;
37      }
38      
39      public String getRef() {
40          return ref;
41      }
42  
43      public void setRef(String ref) {
44          this.ref = ref;
45      }
46  
47      @Override
48      public int hashCode() {
49          final int prime = 31;
50          int result = super.hashCode();
51          result = prime * result + Objects.hash(ref);
52          return result;
53      }
54  
55      @Override
56      public boolean equals(Object obj) {
57          if (this == obj)
58              return true;
59          if (!super.equals(obj))
60              return false;
61          if (getClass() != obj.getClass())
62              return false;
63          AppenderRefModel other = (AppenderRefModel) obj;
64          return Objects.equals(ref, other.ref);
65      }
66      
67  
68  
69  }