Ejemplo n.º 1
0
  @Override
  public MockFlowFile removeAllAttributes(final FlowFile flowFile, final Set<String> attrNames) {
    validateState(flowFile);
    if (attrNames == null || flowFile == null) {
      throw new IllegalArgumentException("argument cannot be null");
    }
    if (!(flowFile instanceof MockFlowFile)) {
      throw new IllegalArgumentException("Cannot export a flow file that I did not create");
    }
    final MockFlowFile mock = (MockFlowFile) flowFile;

    final MockFlowFile newFlowFile = new MockFlowFile(mock.getId(), flowFile);
    currentVersions.put(newFlowFile.getId(), newFlowFile);

    newFlowFile.removeAttributes(attrNames);
    return newFlowFile;
  }