001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2022, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v1.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.access.model;
015
016import java.util.Objects;
017
018import ch.qos.logback.core.model.Model;
019
020public class ConfigurationModel extends Model {
021    
022    private static final long serialVersionUID = 5447825021342728679L;
023
024    public static final String INTERNAL_DEBUG_ATTR = "debug";
025
026    String debug;
027
028    @Override
029    protected ConfigurationModel makeNewInstance() {
030        return new ConfigurationModel();
031    }
032    
033    @Override
034    protected void mirror(Model that) {
035        ConfigurationModel actual = (ConfigurationModel) that;
036        super.mirror(actual);
037        this.debug = actual.debug;
038    }
039    
040    
041    public String getDebug() {
042        return debug;
043    }
044
045    public void setDebug(String debug) {
046        this.debug = debug;
047    }
048
049    @Override
050    public int hashCode() {
051        final int prime = 31;
052        int result = super.hashCode();
053        result = prime * result + Objects.hash(debug);
054        return result;
055    }
056
057    @Override
058    public boolean equals(Object obj) {
059        if (this == obj)
060            return true;
061        if (!super.equals(obj))
062            return false;
063        if (getClass() != obj.getClass())
064            return false;
065        ConfigurationModel other = (ConfigurationModel) obj;
066        return Objects.equals(debug, other.debug);
067    }
068
069}