src-java/base-topology/base-storm-topology/src/test/java/org/openkilda/wfm/share/flow/TestFlowBuilder.java
/**
     * Build a Flow with set properties.
     */
Build a Flow with set properties.
Build a Flow with set properties .
public Flow build() {
        Flow flow = Flow.builder()
                .flowId(flowId)
                .srcSwitch(srcSwitch)
                .srcPort(srcPort)
                .srcVlan(srcVlan)
                .destSwitch(destSwitch)
                .destPort(destPort)
                .destVlan(destVlan)
                .bandwidth(bandwidth)
                .ignoreBandwidth(ignoreBandwidth)
                .encapsulationType(encapsulationType)
                .maxLatency(maxLatency)
                .priority(priority)
                .detectConnectedDevices(detectConnectedDevices)
                .pathComputationStrategy(pathComputationStrategy)
                .description(description)
                .build();
        flow.setStatus(status);
        FlowPath forwardPath =
                buildFlowPath(flow, srcSwitch, destSwitch,
                        cookie != null
                                ? new FlowSegmentCookie(cookie)
                                : new FlowSegmentCookie(FlowPathDirection.FORWARD, unmaskedCookie),
                        meterId != null ? new MeterId(meterId) : null);
        FlowPath reversePath = buildFlowPath(
                flow, destSwitch, srcSwitch,
                new FlowSegmentCookie(FlowPathDirection.REVERSE, unmaskedCookie), null);
        flow.setForwardPath(forwardPath);
        flow.setReversePath(reversePath);
        return flow;
    }
public Flow build ( ) { Flow flow = Flow . builder ( ) . flowId ( flowId ) . srcSwitch ( srcSwitch ) . srcPort ( srcPort ) . srcVlan ( srcVlan ) . destSwitch ( destSwitch ) . destPort ( destPort ) . destVlan ( destVlan ) . bandwidth ( bandwidth ) . ignoreBandwidth ( ignoreBandwidth ) . encapsulationType ( encapsulationType ) . maxLatency ( maxLatency ) . priority ( priority ) . detectConnectedDevices ( detectConnectedDevices ) . pathComputationStrategy ( pathComputationStrategy ) . description ( description ) . build ( ) ; flow . setStatus ( status ) ; FlowPath forwardPath = buildFlowPath ( flow , srcSwitch , destSwitch , cookie != null ? new FlowSegmentCookie ( cookie ) : new FlowSegmentCookie ( FlowPathDirection . FORWARD , unmaskedCookie ) , meterId != null ? new MeterId ( meterId ) : null ) ; FlowPath reversePath = buildFlowPath ( flow , destSwitch , srcSwitch , new FlowSegmentCookie ( FlowPathDirection . REVERSE , unmaskedCookie ) , null ) ; flow . setForwardPath ( forwardPath ) ; flow . setReversePath ( reversePath ) ; return flow ; }
Build a Flow with set properties.
Build a Flow with set properties .