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

com.weaverplatform.protocol.model.ChangeNodeGraphOperation Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
package com.weaverplatform.protocol.model;

import java.util.Objects;

public class ChangeNodeGraphOperation extends WriteOperation {

  private String oldGraph;

  public ChangeNodeGraphOperation(String id, String oldGraph, String newGraph) {
    super(id);
    this.setGraph(newGraph);
    this.oldGraph = oldGraph;
  }

  public String getOldGraph() {
    return oldGraph;
  }

  @Override
  public WriteOperationAction getAction()  {
    return WriteOperationAction.CHANGE_NODE_GRAPH;
  }

  @Override
  public boolean equals(Object obj) {
    if(!(obj instanceof ChangeNodeGraphOperation)) {
      return false;
    }
    ChangeNodeGraphOperation other = (ChangeNodeGraphOperation) obj;
    return Objects.equals(getId(), other.getId())
      && Objects.equals(getGraph(), other.getGraph())
      && Objects.equals(getOldGraph(), other.getOldGraph());
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), getOldGraph());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy