1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  package ch.qos.logback.core.model;
15  
16  import java.util.Objects;
17  
18  public class NamedModel extends Model implements INamedModel {
19  
20      private static final long serialVersionUID = 3549881638769570183L;
21  
22      String name;
23  
24      @Override
25      protected NamedModel makeNewInstance() {
26          return new NamedModel();
27      }
28      
29      @Override
30      protected void mirror(Model that) {
31          NamedModel actual = (NamedModel) that;
32          super.mirror(actual);
33          this.name = actual.name;
34      }
35      
36      public String getName() {
37          return name;
38      }
39  
40      public void setName(String name) {
41          this.name = name;
42      }
43  
44      @Override
45      public int hashCode() {
46          final int prime = 31;
47          int result = super.hashCode();
48          result = prime * result + Objects.hash(name);
49          return result;
50      }
51  
52      @Override
53      public boolean equals(Object obj) {
54          if (this == obj)
55              return true;
56          if (!super.equals(obj))
57              return false;
58          if (getClass() != obj.getClass())
59              return false;
60          NamedModel other = (NamedModel) obj;
61          return Objects.equals(name, other.name);
62      }
63      
64      
65  }