view com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/model/Bundle.java @ 90:8f2dd0dbdb87

Externalize strings
author Omair Majid <omajid@redhat.com>
date Tue, 21 Jan 2014 19:51:04 -0500
parents b788a26c0d4d
children
line wrap: on
line source

package com.redhat.thermostat.tools.eclipse.plugin.model;

import java.util.Objects;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="bundle")
public class Bundle {

    private String name;
    private String version;

    public Bundle() {
        name = null;
        version = null;
    }

    public Bundle(String name, String version) {
        this.name = name;
        this.version = version;
    }

    @XmlElement(name="symbolic-name")
    public String getSymbolicName() {
        return this.name;
    }

    public void setSymbolicName(String name) {
        this.name = name;
    }

    @XmlElement(name="version")
    public String getVersion() {
        return this.version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String toString() {
        return this.name + " (" + this.version + ")"; //$NON-NLS-1$ //$NON-NLS-2$
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Bundle)) {
            return false;
        }
        Bundle other = (Bundle) obj;
        return Objects.equals(this.name, other.name) && Objects.equals(this.version, other.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.name, this.version);
    }
}