org.apache.taverna.scufl2.api.core.Workflow.equals()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.apache.taverna.scufl2.api.core.Workflow.equals()方法的一些代码示例,展示了Workflow.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workflow.equals()方法的具体详情如下:
包路径:org.apache.taverna.scufl2.api.core.Workflow
类名称:Workflow
方法名:equals

Workflow.equals介绍

暂无

代码示例

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api

@Override
public void visitBlockingControlLink(BlockingControlLink bean) {
  // Also checks from Child
  
  Workflow parent = bean.getParent();
  Processor block = bean.getBlock();
  Processor untilFinished = bean.getUntilFinished();
  
  // Check the block and untilFinished processors are in the same workflow
  if (block != null) {
    Workflow blockParent = block.getParent();
    if ((parent == null) || !parent.equals(blockParent))
      listener.outOfScopeValue(bean, "block", block);
  }
  if (untilFinished != null) {
    Workflow untilFinishedParent = untilFinished.getParent();
    if ((parent == null) || !parent.equals(untilFinishedParent))
      listener.outOfScopeValue(bean, "untilFinished", untilFinished);
  }
  // Check the block and untilFinished processors are specified
  if (checkComplete) {
    if (block == null)
      listener.nullField(bean, "block");
    if (untilFinished == null)
      listener.nullField(bean, "untilFinished");
  }
}

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api

Workflow sendsToWorkflow = findAncestral((Child<?>) sendsTo,
    Workflow.class);
if ((parent == null) || !parent.equals(sendsToWorkflow))
  listener.outOfScopeValue(bean, "sendsTo", sendsTo);
Workflow receivesFromWorkflow = findAncestral((Child<?>) receivesFrom,
    Workflow.class);
if ((parent == null) || !parent.equals(receivesFromWorkflow))
  listener.outOfScopeValue(bean, "receivesFrom", receivesFrom);

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api

@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (getClass() != obj.getClass())
    return false;
  BlockingControlLink other = (BlockingControlLink) obj;
  if (getUntilFinished() == null) {
    if (other.getUntilFinished() != null)
      return false;
  } else if (!getUntilFinished().equals(other.getUntilFinished()))
    return false;
  if (getParent() == null) {
    if (other.getParent() != null)
      return false;
  } else if (!getParent().equals(other.getParent()))
    return false;
  if (getBlock() == null) {
    if (other.getBlock() != null)
      return false;
  } else if (!getBlock().equals(other.getBlock()))
    return false;
  return true;
}

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api

@Test 
public void workflowsNotEqualsUnlessOrphans() {
  Workflow wf1 = new Workflow();
  Workflow wf2 = new Workflow();
  wf1.setName("fred");
  wf2.setName("fred");
  // No parents, so they are equal
  assertEquals(wf1, wf2);
  
  
  WorkflowBundle wb1 = new WorkflowBundle();
  
  WorkflowBundle wb2 = new WorkflowBundle();
  // Make them look "equal"
  wb2.setName(wb1.getName());
  wb2.setGlobalBaseURI(wb1.getGlobalBaseURI());
  assertFalse(wb1.equals(wb2));
  
  wf1.setParent(wb1);
  wf2.setParent(wb2);        
  assertFalse(wf1.equals(wf2));
  
  wf1.setParent(null);
  assertFalse(wf1.equals(wf2));
  assertFalse(wf2.equals(wf1));
  wf2.setParent(null);
  assertTrue(wf1.equals(wf2));	
}

相关文章