001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2021, 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
018import ch.qos.logback.core.model.processor.PhaseIndicator;
019import ch.qos.logback.core.model.processor.ProcessingPhase;
020
021@PhaseIndicator(phase = ProcessingPhase.SECOND)
022public class AppenderRefModel extends Model {
023
024    private static final long serialVersionUID = 5238705468395447547L;
025
026    String ref;
027
028    protected AppenderRefModel makeNewInstance() {
029        return new AppenderRefModel();
030    }
031    
032    @Override
033    protected void mirror(Model that) {
034        AppenderRefModel actual = (AppenderRefModel) that;
035        super.mirror(actual);
036        this.ref = actual.ref;
037    }
038    
039    public String getRef() {
040        return ref;
041    }
042
043    public void setRef(String ref) {
044        this.ref = ref;
045    }
046
047    @Override
048    public int hashCode() {
049        final int prime = 31;
050        int result = super.hashCode();
051        result = prime * result + Objects.hash(ref);
052        return result;
053    }
054
055    @Override
056    public boolean equals(Object obj) {
057        if (this == obj)
058            return true;
059        if (!super.equals(obj))
060            return false;
061        if (getClass() != obj.getClass())
062            return false;
063        AppenderRefModel other = (AppenderRefModel) obj;
064        return Objects.equals(ref, other.ref);
065    }
066    
067
068
069}