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

com.spotinst.sdkjava.model.ApiDetachInstancesRequestConverter Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.LinkedList;

/**
 * Created by talzur on 16/01/2017.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
class ApiDetachInstancesRequestConverter {

    static ApiDetachInstancesRequest toDal(ElastigroupDetachInstancesRequest request) {
        ApiDetachInstancesRequest retVal = null;

        if (request != null) {
            retVal = new ApiDetachInstancesRequest();

            if (request.getInstancesToDetach() != null) {
                retVal.setInstancesToDetach(new LinkedList<>(request.getInstancesToDetach()));
            }

            retVal.setShouldDecrementTargetCapacity(request.getShouldDecrementTargetCapacity());
            retVal.setShouldTerminateInstances(request.getShouldTerminateInstances());
            retVal.setDrainingTimeout(request.getDrainingTimeout());
        }

        return retVal;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy