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

com.weaverplatform.protocol.model.ChangeNodeIdOperation 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 ChangeNodeIdOperation extends WriteOperation {

  private String oldId, oldGraph;

  public ChangeNodeIdOperation(String oldId, String oldGraph, String newId) {
    super(newId);
    this.setGraph(oldGraph);
    this.oldId = oldId;
    this.oldGraph = oldGraph;
  }

  public String getOldId() {
    return oldId;
  }

  public String getOldGraph() {
    return oldGraph;
  }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy