org.bidib.wizard.api.model.connection.AbstractMessageEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-api Show documentation
Show all versions of bidibwizard-api Show documentation
jBiDiB BiDiB Wizard API POM
package org.bidib.wizard.api.model.connection;
import java.util.Arrays;
import org.bidib.wizard.api.model.NodeInterface;
public abstract class AbstractMessageEvent extends AbstractQueueEvent {
private final byte[] address;
private final int messageNum;
private final int messageType;
/**
* @param connectionId
* @param address
*/
public AbstractMessageEvent(String connectionId, byte[] address, int messageNum, int messageType) {
super(connectionId);
this.address = address;
this.messageNum = messageNum;
this.messageType = messageType;
}
/**
* @return the address
*/
public byte[] getAddress() {
return address;
}
/**
* @return the messageNum
*/
public int getMessageNum() {
return messageNum;
}
/**
* @return the messageType
*/
public int getMessageType() {
return messageType;
}
/**
* Check if the node is matching.
*
* @param node
* the node
* @return {@code true}: the node is matching, {@code false} otherwise
*/
public boolean isMatchingNode(final NodeInterface node) {
if (node != null && Arrays.equals(getAddress(), node.getAddr())) {
return true;
}
return false;
}
}