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

org.bidib.wizard.api.notification.NodeUpdate Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
package org.bidib.wizard.api.notification;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.bidib.api.json.types.NodeInfo.NodeAction;
import org.bidib.wizard.api.model.NodeInterface;

public class NodeUpdate {

    private String connectionId;

    private NodeAction nodeAction;

    private NodeInterface node;

    public NodeUpdate(String connectionId, NodeAction nodeAction, NodeInterface node) {
        this.connectionId = connectionId;
        this.nodeAction = nodeAction;
        this.node = node;
    }

    public String getConnectionId() {
        return connectionId;
    }

    public NodeAction getNodeAction() {
        return nodeAction;
    }

    public void setNodeAction(NodeAction nodeAction) {
        this.nodeAction = nodeAction;
    }

    public NodeInterface getNode() {
        return node;
    }

    public void setNode(NodeInterface node) {
        this.node = node;
    }
    
    

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((connectionId == null) ? 0 : connectionId.hashCode());
        result = prime * result + ((node == null) ? 0 : node.hashCode());
        result = prime * result + ((nodeAction == null) ? 0 : nodeAction.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        NodeUpdate other = (NodeUpdate) obj;
        if (connectionId == null) {
            if (other.connectionId != null)
                return false;
        }
        else if (!connectionId.equals(other.connectionId))
            return false;
        if (node == null) {
            if (other.node != null)
                return false;
        }
        else if (!node.equals(other.node))
            return false;
        if (nodeAction != other.nodeAction)
            return false;
        return true;
    }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy