Class NodeIDEnt

java.lang.Object
org.knime.gateway.api.entity.NodeIDEnt

public final class NodeIDEnt extends Object
Represents a node id as used by gateway entities and services (and the UI in general). Equivalent to the core's NodeID.
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany
  • Constructor Details

    • NodeIDEnt

      public NodeIDEnt(int... ids)
      Creates the node id from a list of hierarchical node ids.
      Parameters:
      ids - the ids of the single nodes that form the node hierarchy
    • NodeIDEnt

      public NodeIDEnt(org.knime.core.node.workflow.NodeID nodeID)
      Parameters:
      nodeID - the node id to create the entity from
    • NodeIDEnt

      public NodeIDEnt(org.knime.core.node.workflow.NodeID nodeID, boolean hasComponentProjectParent)
      Parameters:
      nodeID - the node id to create the entity from
      hasComponentProjectParent - if the node with the given id is part of a component project; if so, an unnecessary '0' is removed; e.g. instead of 'root:0:4:5', 'root:4:5' is used
    • NodeIDEnt

      public NodeIDEnt(String s)
      Deserialization constructor.
      Parameters:
      s - string representation as returned by toString()
  • Method Details

    • getRootID

      public static NodeIDEnt getRootID()
      The id representing the root node (i.e. the node that 'contains' the root workflow).
      Returns:
      the node id entity
    • appendNodeID

      public NodeIDEnt appendNodeID(int id)
      Appends the given single node id to this id and returns a copy.
      Parameters:
      id - the id to append
      Returns:
      a new node id entity
    • toNodeID

      public org.knime.core.node.workflow.NodeID toNodeID(org.knime.core.node.workflow.NodeID rootID)
      Converts the entity into a NodeID object.
      Parameters:
      rootID - the root node id to be prepended
      Returns:
      the node id object
    • getNodeIDs

      public int[] getNodeIDs()
      Returns:
      the individual nested node ids
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the node id as string
    • isEqualOrParentOf

      public boolean isEqualOrParentOf(NodeIDEnt id)
      Parameters:
      id - the id to check agains
      Returns:
      true if this node id is equal or a parent node id of the passed id; otherwise false
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object