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