All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.dmx.client.model.DmxChannelConfig Maven / Gradle / Ivy

The newest version!
package org.bidib.wizard.dmx.client.model;

import java.util.Objects;

import com.jgoodies.binding.beans.Model;

public class DmxChannelConfig extends Model {
    private static final long serialVersionUID = 1L;

    public static final String PROPERTY_DMX_CHANNEL_ID = "dmxChannelId";

    public static final String PROPERTY_DMX_CV_NUMBER = "cvNumber";

    private Integer dmxChannelId;

    private final int cvNumber;

    public DmxChannelConfig(int cvNumber, Integer dmxChannelId) {
        this.cvNumber = cvNumber;
        this.dmxChannelId = dmxChannelId;
    }

    public void setDmxChannelId(Integer dmxChannelId) {
        Integer oldValue = this.dmxChannelId;
        this.dmxChannelId = dmxChannelId;

        firePropertyChange(PROPERTY_DMX_CHANNEL_ID, oldValue, dmxChannelId);
    }

    public Integer getDmxChannelId() {
        return dmxChannelId;
    }

    public int getCvNumber() {
        return cvNumber;
    }

    @Override
    public int hashCode() {
        return Objects.hash(cvNumber, dmxChannelId);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DmxChannelConfig other = (DmxChannelConfig) obj;
        return cvNumber == other.cvNumber && Objects.equals(dmxChannelId, other.dmxChannelId);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy