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.core.model;
015
016import java.util.Objects;
017
018public class DefineModel extends NamedComponentModel {
019
020    private static final long serialVersionUID = 6209642548924431065L;
021    String scopeStr;
022
023    @Override
024    protected DefineModel makeNewInstance() {
025        return new DefineModel();
026    }
027    
028    @Override
029    protected void mirror(Model that) {
030        DefineModel actual = (DefineModel) that;
031        super.mirror(actual);
032        this.scopeStr = actual.scopeStr;
033    }
034
035    public String getScopeStr() {
036        return scopeStr;
037    }
038
039    public void setScopeStr(String scopeStr) {
040        this.scopeStr = scopeStr;
041    }
042
043    @Override
044    public int hashCode() {
045        final int prime = 31;
046        int result = super.hashCode();
047        result = prime * result + Objects.hash(scopeStr);
048        return result;
049    }
050
051    @Override
052    public boolean equals(Object obj) {
053        if (this == obj)
054            return true;
055        if (!super.equals(obj))
056            return false;
057        if (getClass() != obj.getClass())
058            return false;
059        DefineModel other = (DefineModel) obj;
060        return Objects.equals(scopeStr, other.scopeStr);
061    }
062
063    
064}