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

org.bidib.wizard.model.dmx.DmxTimelineWrapper Maven / Gradle / Ivy

There is a newer version: 2.0.26
Show newest version
package org.bidib.wizard.model.dmx;

import java.util.Objects;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.jgoodies.binding.beans.Model;

public final class DmxTimelineWrapper extends Model {

    private static final long serialVersionUID = 1L;

    public static final String PROPERTY_DMX_TIME = "dmxTime";

    private Integer dmxTime;

    private final int cvNumberHigh;

    private final int cvNumberLow;

    public DmxTimelineWrapper(Integer dmxTime, int cvNumberHigh, int cvNumberLow) {
        this.dmxTime = dmxTime;
        this.cvNumberHigh = cvNumberHigh;
        this.cvNumberLow = cvNumberLow;
    }

    public int getCvNumberHigh() {
        return cvNumberHigh;
    }

    public int getCvNumberLow() {
        return cvNumberLow;
    }

    public Integer getDmxTime() {
        return dmxTime;
    }

    public void setDmxTime(Integer dmxTime) {
        Integer oldValue = this.dmxTime;
        this.dmxTime = dmxTime;

        firePropertyChange(PROPERTY_DMX_TIME, oldValue, this.dmxTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cvNumberHigh, cvNumberLow, dmxTime);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DmxTimelineWrapper other = (DmxTimelineWrapper) obj;
        return cvNumberHigh == other.cvNumberHigh && cvNumberLow == other.cvNumberLow
            && Objects.equals(dmxTime, other.dmxTime);
    }

    public static DmxTimelineWrapper searchKey(Integer dmxTime) {
        return new DmxTimelineWrapper(dmxTime, -1, -1);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy