The class with functionality for the base edge type.

Type Parameters

Hierarchy (view full)

Accessors

Methods

  • Changes the functionality class of the current edge. This is only possible if the data and scratch data are compatible with the new class. To assert that, use BaseEdge.Class.is.

    Type Parameters

    Parameters

    • EdgeType: {
          Class: Edge.Class<D, S, E>;
      }

      The edge type to change the functionality class into.

    Returns E

    The same edge, wrapped in the new functionality class.

  • Changes the functionality class of the current edge. Should only be used when it is known (but not statically provable) that the edge is compatible with the new class. If not, an error will be thrown.

    It is bad practice to try and catch the error thrown by this function. For such cases, combine BaseEdge.Class.is with BaseEdge.Class.as, or use BaseEdge.Class.switch instead.

    Type Parameters

    Parameters

    • EdgeType: Edge<D2, S2, E2>

      The edge type to change the functionality class into.

    • Optionalmessage: string

      The message to throw if the edge is not compatible with the type.

    Returns E2

    The edge, wrapped in the new functionality class.

    LaraFlowError if the edge is not compatible with the type. This error should be seen as a logic error and not catched.

  • Initializes the edge with the information of a builder. This is effectively extends the type of the edge to include the data and scratch data of the builder.

    The same edge may simultaneously be of multiple types, as long as the data and scratch data are compatible with the types. The builder methods may overwrite data and scratch data fields with names that collide with its type's fields.

    Type Parameters

    Parameters

    Returns BaseEdge.Class<D2, S2>

    The same edge, with the data and scratch data of the builder. The edge is downcasted to BaseEdge.Class because the builder may overwrite the data and scratch data fields, invalidating the current type.

  • Tries to change the functionality class of the current edge. If the edge is not compatible with the new class, undefined is returned.

    Type Parameters

    Parameters

    • EdgeType: Edge<D2, S2, E2>

      The edge type to change the functionality class into.

    Returns undefined | E2

    The edge, wrapped in the new functionality class, or undefined if the edge is not compatible with the type.