Class Connection


public final class Connection extends PArray.ArrayBasedValue
A type representing a connection between two ports.
  • Field Details

  • Method Details

    • sourceComponent

      public String sourceComponent()
      Query the component ID of the source component.
      Returns:
      ID of first child
    • sourcePort

      public String sourcePort()
      Query the port ID of the source port.
      Returns:
      ID of port on first child
    • targetComponent

      public String targetComponent()
      Query the component ID of the target component.
      Returns:
      ID of the second child
    • targetPort

      public String targetPort()
      Query the port ID of the target port.
      Returns:
      ID of port on second child
    • of

      public static Connection of(String child1, String port1, String child2, String port2)
      Create a connection reference. The child IDs must be valid according to ComponentAddress.isValidID(java.lang.String). The port IDs must be valid according to PortAddress.isValidID(java.lang.String).
      Parameters:
      child1 - ID of first child
      port1 - ID of port on first child
      child2 - ID of second child
      port2 - ID of port on second child
      Returns:
      new connection
      Throws:
      IllegalArgumentException - if the IDs are not valid
    • from

      public static Optional<Connection> from(Value value)
      Coerce the provided value into a Connection if possible.
      Parameters:
      value - value of unknown type
      Returns:
      connection or empty optional