001package ch.qos.logback.classic.model;
002
003import java.util.Objects;
004
005import ch.qos.logback.core.model.Model;
006import ch.qos.logback.core.util.Duration;
007
008public class ConfigurationModel extends Model {
009
010    private static final long serialVersionUID = 1286156598561818515L;
011    static final String DEBUG_SYSTEM_PROPERTY_KEY = "logback.debug";
012    static final Duration SCAN_PERIOD_DEFAULT = Duration.buildByMinutes(1);
013
014    String debugStr;
015    String scanStr;
016    String scanPeriodStr;
017    String packagingDataStr;
018    
019    @Override
020    protected ConfigurationModel makeNewInstance() {
021        return new ConfigurationModel();
022    }
023    
024    @Override protected void mirror(Model that) {
025        ConfigurationModel actual = (ConfigurationModel) that;
026        super.mirror(that);
027        this.debugStr = actual.debugStr;
028        this.scanStr = actual.scanStr;
029        this.scanPeriodStr = actual.scanPeriodStr;
030        this.packagingDataStr = actual.packagingDataStr;
031    }
032    
033    public String getDebugStr() {
034        return debugStr;
035    }
036
037    public void setDebugStr(String debugStr) {
038        this.debugStr = debugStr;
039    }
040
041    public String getScanStr() {
042        return scanStr;
043    }
044
045    public void setScanStr(String scanStr) {
046        this.scanStr = scanStr;
047    }
048
049    public String getScanPeriodStr() {
050        return scanPeriodStr;
051    }
052
053    public void setScanPeriodStr(String scanPeriodStr) {
054        this.scanPeriodStr = scanPeriodStr;
055    }
056
057    public String getPackagingDataStr() {
058        return packagingDataStr;
059    }
060
061    public void setPackagingDataStr(String packagingDataStr) {
062        this.packagingDataStr = packagingDataStr;
063    }
064    
065    @Override
066    public int hashCode() {
067        final int prime = 31;
068        int result = super.hashCode();
069        result = prime * result + Objects.hash(debugStr, packagingDataStr, scanPeriodStr, scanStr);
070        return result;
071    }
072
073    @Override
074    public boolean equals(Object obj) {
075        if (this == obj)
076            return true;
077        if (!super.equals(obj))
078            return false;
079        if (getClass() != obj.getClass())
080            return false;
081        ConfigurationModel other = (ConfigurationModel) obj;
082        return Objects.equals(debugStr, other.debugStr) && Objects.equals(packagingDataStr, other.packagingDataStr)
083                && Objects.equals(scanPeriodStr, other.scanPeriodStr) && Objects.equals(scanStr, other.scanStr);
084    }
085
086}