View Javadoc
1   /*
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2023, 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  
15  package ch.qos.logback.classic.spi;
16  
17  import ch.qos.logback.classic.LoggerContext;
18  
19  import java.util.Map;
20  import java.util.Objects;
21  
22  /**
23   * PubLoggerContextVO is a very open (public) version of LoggerContextVO
24   *
25   * @since 1.4.8
26   */
27  public class PubLoggerContextVO extends LoggerContextVO {
28  
29  
30      public PubLoggerContextVO(LoggerContext lc) {
31         super(lc);
32      }
33  
34      public PubLoggerContextVO(String name, Map<String, String> propertyMap, long birthTime) {
35          super(name, propertyMap, birthTime);
36      }
37  
38      public void setName(String name) {
39          this.name = name;
40      }
41  
42      public void setPropertyMap(Map<String, String> propertyMap) {
43          this.propertyMap = propertyMap;
44      }
45  
46  
47      public void setBirthTime(long birthTime) {
48          this.birthTime = birthTime;
49      }
50  
51      @Override
52      public boolean equals(Object o) {
53          if (this == o)
54              return true;
55          if (o == null || getClass() != o.getClass())
56              return false;
57          PubLoggerContextVO that = (PubLoggerContextVO) o;
58          return birthTime == that.birthTime && Objects.equals(name, that.name) && Objects.equals(propertyMap,
59                  that.propertyMap);
60      }
61  
62      @Override
63      public int hashCode() {
64          return Objects.hash(name, propertyMap, birthTime);
65      }
66  }