001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2015, 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.classic.spi;
015
016import java.io.Serializable;
017
018@Deprecated
019public class ClassPackagingData implements Serializable {
020
021    private static final long serialVersionUID = -804643281218337001L;
022    String codeLocation;
023    String version;
024    boolean exact;
025
026    public ClassPackagingData() {
027
028    }
029
030    public ClassPackagingData(String codeLocation, String version) {
031        this.codeLocation = codeLocation;
032        this.version = version;
033        this.exact = true;
034    }
035
036    public ClassPackagingData(String classLocation, String version, boolean exact) {
037        this.codeLocation = classLocation;
038        this.version = version;
039        this.exact = exact;
040    }
041
042    public String getCodeLocation() {
043        return codeLocation;
044    }
045
046    public String getVersion() {
047        return version;
048    }
049
050    public boolean isExact() {
051        return exact;
052    }
053
054    public void setCodeLocation(String codeLocation) {
055        this.codeLocation = codeLocation;
056    }
057
058    public void setVersion(String version) {
059        this.version = version;
060    }
061
062    public void setExact(boolean exact) {
063        this.exact = exact;
064    }
065
066    @Override
067    public int hashCode() {
068        final int PRIME = 31;
069        int result = 1;
070        result = PRIME * result + ((codeLocation == null) ? 0 : codeLocation.hashCode());
071        return result;
072    }
073
074    @Override
075    public boolean equals(Object obj) {
076        if (this == obj)
077            return true;
078        if (obj == null)
079            return false;
080        if (getClass() != obj.getClass())
081            return false;
082        final ClassPackagingData other = (ClassPackagingData) obj;
083        if (codeLocation == null) {
084            if (other.codeLocation != null)
085                return false;
086        } else if (!codeLocation.equals(other.codeLocation))
087            return false;
088        if (exact != other.exact)
089            return false;
090        if (version == null) {
091            if (other.version != null)
092                return false;
093        } else if (!version.equals(other.version))
094            return false;
095        return true;
096    }
097
098}