package usda.weru.weps.fuel;

import javax.measure.Measurable;

/**
 *
 * @author josephalevin
 */
public class Fuel {

    private String name;
    private String displayName;
    private String description;
    private Measurable<EnergyPerVolume> energy;
    private Measurable<PricePerVolume> price;

    /**
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     *
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     *
     * @return
     */
    public String getDisplayName() {
        return displayName;
    }

    /**
     *
     * @param displayName
     */
    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    /**
     *
     * @param description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     *
     * @return
     */
    public Measurable<EnergyPerVolume> getEnergy() {
        return energy;
    }

    /**
     *
     * @return
     */
    public String getDescription() {
        return description;
    }

    /**
     *
     * @param energy
     */
    public void setEnergy(Measurable<EnergyPerVolume> energy) {
        this.energy = energy;
    }

    /**
     *
     * @param price
     */
    public void setPrice(Measurable<PricePerVolume> price) {
        this.price = price;
    }

    /**
     *
     * @return
     */
    public Measurable<PricePerVolume> getPrice() {
        return price;
    }

    /**
     *
     * @param obj
     * @return
     */
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Fuel other = (Fuel) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        if ((this.displayName == null) ? (other.displayName != null) : !this.displayName.equals(other.displayName)) {
            return false;
        }
        if ((this.description == null) ? (other.description != null) : !this.description.equals(other.description)) {
            return false;
        }
        if (this.energy != other.energy && (this.energy == null || !this.energy.equals(other.energy))) {
            return false;
        }
        if (this.price != other.price && (this.price == null || !this.price.equals(other.price))) {
            return false;
        }
        return true;
    }

    /**
     *
     * @return
     */
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    /**
     *
     * @return
     */
    @Override
    public String toString() {
        return name;
    }

}
