org.bidib.wizard.dmx.client.model.DmxChannelConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-dmx-client Show documentation
Show all versions of bidibwizard-dmx-client Show documentation
jBiDiB BiDiB Wizard DMX client POM
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);
}
}