001package ch.qos.logback.core.model;
002
003import java.util.Objects;
004
005public class PropertyModel extends NamedModel {
006
007    private static final long serialVersionUID = 1494176979175092052L;
008    
009    String value;
010    String scopeStr;
011
012    String file;
013    String resource;
014
015    @Override
016    protected PropertyModel makeNewInstance() {
017        return new PropertyModel();
018    }
019    
020    @Override
021    protected void mirror(Model that) {
022        PropertyModel actual = (PropertyModel) that;
023        super.mirror(actual);
024        this.value = actual.value;
025        this.scopeStr = actual.scopeStr;
026        this.file = actual.file;
027        this.resource = actual.resource;
028        
029    }
030    
031    public String getValue() {
032        return value;
033    }
034
035    public void setValue(String value) {
036        this.value = value;
037    }
038
039    public String getScopeStr() {
040        return scopeStr;
041    }
042
043    public void setScopeStr(String scopeStr) {
044        this.scopeStr = scopeStr;
045    }
046
047    public String getFile() {
048        return file;
049    }
050
051    public void setFile(String file) {
052        this.file = file;
053    }
054
055    public String getResource() {
056        return resource;
057    }
058
059    public void setResource(String resource) {
060        this.resource = resource;
061    }
062
063    @Override
064    public int hashCode() {
065        final int prime = 31;
066        int result = super.hashCode();
067        result = prime * result + Objects.hash(file, resource, scopeStr, value);
068        return result;
069    }
070
071    @Override
072    public boolean equals(Object obj) {
073        if (this == obj)
074            return true;
075        if (!super.equals(obj))
076            return false;
077        if (getClass() != obj.getClass())
078            return false;
079        PropertyModel other = (PropertyModel) obj;
080        return Objects.equals(file, other.file) && Objects.equals(resource, other.resource)
081                && Objects.equals(scopeStr, other.scopeStr) && Objects.equals(value, other.value);
082    }
083
084    
085}