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