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.core.model;
16  
17  import java.util.Objects;
18  
19  public class PropertyModel extends NamedModel {
20  
21      private static final long serialVersionUID = 1494176979175092052L;
22      
23      String value;
24      String scopeStr;
25  
26      String file;
27      String resource;
28  
29      @Override
30      protected PropertyModel makeNewInstance() {
31          return new PropertyModel();
32      }
33      
34      @Override
35      protected void mirror(Model that) {
36          PropertyModel actual = (PropertyModel) that;
37          super.mirror(actual);
38          this.value = actual.value;
39          this.scopeStr = actual.scopeStr;
40          this.file = actual.file;
41          this.resource = actual.resource;
42          
43      }
44      
45      public String getValue() {
46          return value;
47      }
48  
49      public void setValue(String value) {
50          this.value = value;
51      }
52  
53      public String getScopeStr() {
54          return scopeStr;
55      }
56  
57      public void setScopeStr(String scopeStr) {
58          this.scopeStr = scopeStr;
59      }
60  
61      public String getFile() {
62          return file;
63      }
64  
65      public void setFile(String file) {
66          this.file = file;
67      }
68  
69      public String getResource() {
70          return resource;
71      }
72  
73      public void setResource(String resource) {
74          this.resource = resource;
75      }
76  
77      @Override
78      public int hashCode() {
79          final int prime = 31;
80          int result = super.hashCode();
81          result = prime * result + Objects.hash(file, resource, scopeStr, value);
82          return result;
83      }
84  
85      @Override
86      public boolean equals(Object obj) {
87          if (this == obj)
88              return true;
89          if (!super.equals(obj))
90              return false;
91          if (getClass() != obj.getClass())
92              return false;
93          PropertyModel other = (PropertyModel) obj;
94          return Objects.equals(file, other.file) && Objects.equals(resource, other.resource)
95                  && Objects.equals(scopeStr, other.scopeStr) && Objects.equals(value, other.value);
96      }
97  
98      
99  }