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