Class NodeUtils

java.lang.Object
org.bidib.wizard.utils.NodeUtils

public class NodeUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addImportError(Map<String,Object> params, String message)
     
    static org.bidib.wizard.api.model.NodeInterface
    configureFromBiDiB(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, CvDefinitionTreeModelRegistry cvDefinitionTreeModelRegistry, org.bidib.wizard.api.model.NodeInterface node, Map<String,Object> importParams, org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper, boolean restoreCVs, boolean restoreFeatures, boolean restoreNodeString, boolean restoreMacroContent, boolean restoreAccessoryContent)
    Configure the node from the provided BiDiB data.
    static org.bidib.jbidibc.core.schema.bidib2.BiDiB
    convertToBiDiB(org.bidib.wizard.api.model.NodeInterface node, Map<String,CvNode> cvNumberToNodeMap, String lang, boolean skipCvValues, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper)
    Convert the node to BiDiB data.
    static String
    findFirmwareReleaseOfBackup(org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib)
    Find the firmware release version of the backup.
    static org.bidib.wizard.api.model.NodeInterface
    findNodeByUuid(Iterable<org.bidib.wizard.api.model.NodeInterface> nodes, long uuid)
    Find a node by its node uuid in the provided list of nodes.
    getCvDefinitionTreeTableModel(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context)
     
    static Map<String,CvNode>
    getCvNumberToNodeMap(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context)
     
    static <P extends org.bidib.wizard.model.ports.Port<?>>
    P
    getPort(List<P> ports, int portNumber, boolean sourceIsFlatPortModel, boolean targetIsFlatPortModel)
     
    static void
    loadDataFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, boolean loadMacroContent, boolean loadCvs)
    Load data from node.
    static org.bidib.wizard.api.model.Macro
    loadMacroContentFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Macro macro)
     
    static String
    prepareLabel(org.bidib.wizard.api.model.NodeInterface node)
    Prepare the node label based on the user string with fallback to node.toString().
    static void
    setCurrentPortType(org.bidib.wizard.model.ports.GenericPort genericPort, org.bidib.jbidibc.messages.enums.LcOutputType portType)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NodeUtils

      public NodeUtils()
  • Method Details

    • findNodeByUuid

      public static org.bidib.wizard.api.model.NodeInterface findNodeByUuid(Iterable<org.bidib.wizard.api.model.NodeInterface> nodes, long uuid)
      Find a node by its node uuid in the provided list of nodes.
      Parameters:
      nodes - the list of nodes
      uuid - the uuid of the node to find
      Returns:
      the found node or null if no node was found with the provided node uuid
    • prepareLabel

      public static String prepareLabel(org.bidib.wizard.api.model.NodeInterface node)
      Prepare the node label based on the user string with fallback to node.toString().
      Parameters:
      node - the node
      Returns:
      the node label
    • findFirmwareReleaseOfBackup

      public static String findFirmwareReleaseOfBackup(org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib)
      Find the firmware release version of the backup.
      Parameters:
      bidib - the bidib instance
      Returns:
      the firmware release version or null if not available
    • configureFromBiDiB

      public static org.bidib.wizard.api.model.NodeInterface configureFromBiDiB(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, CvDefinitionTreeModelRegistry cvDefinitionTreeModelRegistry, org.bidib.wizard.api.model.NodeInterface node, Map<String,Object> importParams, org.bidib.jbidibc.core.schema.bidib2.BiDiB bidib, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper, boolean restoreCVs, boolean restoreFeatures, boolean restoreNodeString, boolean restoreMacroContent, boolean restoreAccessoryContent)
      Configure the node from the provided BiDiB data.
      Parameters:
      node - the node
      bidib - the BiDiB data
      Returns:
      the configured node
    • setCurrentPortType

      public static void setCurrentPortType(org.bidib.wizard.model.ports.GenericPort genericPort, org.bidib.jbidibc.messages.enums.LcOutputType portType)
    • addImportError

      public static void addImportError(Map<String,Object> params, String message)
    • convertToBiDiB

      public static org.bidib.jbidibc.core.schema.bidib2.BiDiB convertToBiDiB(org.bidib.wizard.api.model.NodeInterface node, Map<String,CvNode> cvNumberToNodeMap, String lang, boolean skipCvValues, org.bidib.wizard.common.labels.WizardLabelWrapper wizardLabelWrapper)
      Convert the node to BiDiB data.
      Parameters:
      node - the node
      Returns:
      the BiDiB data
    • getPort

      public static <P extends org.bidib.wizard.model.ports.Port<?>> P getPort(List<P> ports, int portNumber, boolean sourceIsFlatPortModel, boolean targetIsFlatPortModel)
    • getCvNumberToNodeMap

      public static Map<String,CvNode> getCvNumberToNodeMap(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context)
    • getCvDefinitionTreeTableModel

      public static CvDefinitionTreeTableModel getCvDefinitionTreeTableModel(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.context.ApplicationContext context)
    • loadDataFromNode

      public static void loadDataFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, boolean loadMacroContent, boolean loadCvs)
      Load data from node.
      Parameters:
      connectionId - the connection id
      nodeService - the node service
      switchingNodeService - the switching node service
      node - the node
      loadMacroContent - load macro content from node
      loadCvs - load CVs from node
    • loadMacroContentFromNode

      public static org.bidib.wizard.api.model.Macro loadMacroContentFromNode(String connectionId, org.bidib.wizard.api.service.node.NodeService nodeService, org.bidib.wizard.api.service.node.SwitchingNodeService switchingNodeService, org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Macro macro)