All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartbear.readyapi.client.teststeps.propertytransfer.PropertyTransferBuilder Maven / Gradle / Ivy

Go to download

Java client library for creating and executing test recipes against Ready!API TestServer

There is a newer version: 1.2.1
Show newest version
package com.smartbear.readyapi.client.teststeps.propertytransfer;

import com.smartbear.readyapi.client.model.PropertyTransfer;

public class PropertyTransferBuilder {
    private PropertyTransfer transfer = new PropertyTransfer();
    private PropertyTransferSourceBuilder propertyTransferSourceBuilder;
    private PropertyTransferTargetBuilder propertyTransferTargetBuilder;

    public static PropertyTransferBuilder from(PropertyTransferSourceBuilder propertyTransferSourceBuilder) {
        return new PropertyTransferBuilder().withSource(propertyTransferSourceBuilder);
    }

    public static PropertyTransferBuilder newTransfer() {
        return new PropertyTransferBuilder();
    }

    public PropertyTransferBuilder withSource(PropertyTransferSourceBuilder propertyTransferSourceBuilder) {
        this.propertyTransferSourceBuilder = propertyTransferSourceBuilder;
        return this;
    }

    public PropertyTransferBuilder withTarget(PropertyTransferTargetBuilder propertyTransferTargetBuilder) {
        return to(propertyTransferTargetBuilder);
    }

    public PropertyTransferBuilder to(PropertyTransferTargetBuilder propertyTransferTargetBuilder) {
        this.propertyTransferTargetBuilder = propertyTransferTargetBuilder;
        return this;
    }


    PropertyTransfer build() {
        if (propertyTransferSourceBuilder == null) {
            throw new IllegalStateException("No source defined for property transfer");
        }
        if (propertyTransferTargetBuilder == null) {
            throw new IllegalStateException("No target defined for property transfer");
        }
        transfer.setSource(propertyTransferSourceBuilder.build());
        transfer.setTarget(propertyTransferTargetBuilder.build());
        return transfer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy