View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2022, 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  public class DefineModel extends NamedComponentModel {
19  
20      private static final long serialVersionUID = 6209642548924431065L;
21      String scopeStr;
22  
23      @Override
24      protected DefineModel makeNewInstance() {
25          return new DefineModel();
26      }
27      
28      @Override
29      protected void mirror(Model that) {
30          DefineModel actual = (DefineModel) that;
31          super.mirror(actual);
32          this.scopeStr = actual.scopeStr;
33      }
34  
35      public String getScopeStr() {
36          return scopeStr;
37      }
38  
39      public void setScopeStr(String scopeStr) {
40          this.scopeStr = scopeStr;
41      }
42  
43      @Override
44      public int hashCode() {
45          final int prime = 31;
46          int result = super.hashCode();
47          result = prime * result + Objects.hash(scopeStr);
48          return result;
49      }
50  
51      @Override
52      public boolean equals(Object obj) {
53          if (this == obj)
54              return true;
55          if (!super.equals(obj))
56              return false;
57          if (getClass() != obj.getClass())
58              return false;
59          DefineModel other = (DefineModel) obj;
60          return Objects.equals(scopeStr, other.scopeStr);
61      }
62  
63      
64  }