Interface DeltaNode

All Superinterfaces:
Delta

public interface DeltaNode extends Delta
A node in the results of a FolderComparison: one file or folder, with the Resource found at each Role and the result of comparing them.

 const nodes = comp.getAllDeltas();
 for (let i = 0; i < nodes.length; i++) {
     const inRef = nodes[i].resource(Role.REF);
     const inOne = nodes[i].resource(Role.ONE);
     if (inRef && !inOne) {
         console.log('Only in Role.REF: ' + inRef.getPath());
     }
 }
 
Since:
2.0
  • Method Details

    • detail

      DeltaNodeDetail detail(Role[] relation)
      Returns details about the differences between the resources of the specified relation, such as the comparison methods that found them.
      Parameters:
      relation - the two roles of the relation of interest, for example [Role.REF, Role.ONE]; cannot be null
      Returns:
      the details, or null if none are available
      Throws:
      NullPointerException - if relation is null
      IllegalArgumentException - if relation is not a valid pair of roles
      Since:
      2.0
    • resource

      Resource resource(Role role)
      Returns the Resource - file or folder - this node has at the specified Role.
      Parameters:
      role - a role of this comparison; cannot be null
      Returns:
      the resource at the specified role, or null if the file or folder does not exist at that role
      Throws:
      NullPointerException - if role is null
      IllegalArgumentException - if role is invalid for this node, for instance Role.TWO for a node that represents a 2-way comparison.
      Since:
      2.0