Example usage for com.amazonaws.util StringUtils fromInteger

List of usage examples for com.amazonaws.util StringUtils fromInteger

Introduction

In this page you can find the example usage for com.amazonaws.util StringUtils fromInteger.

Prototype

public static String fromInteger(Integer value) 

Source Link

Usage

From source file:com.github.sjones4.youcan.youtoken.model.transform.GetAccessTokenRequestMarshaller.java

License:Open Source License

public Request<GetAccessTokenRequest> marshall(GetAccessTokenRequest getAccessTokenRequest) {

    if (getAccessTokenRequest == null) {
        throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }//  ww w .j av a  2  s .  com

    Request<GetAccessTokenRequest> request = new DefaultRequest<GetAccessTokenRequest>(getAccessTokenRequest,
            "AWSSecurityTokenService");
    request.addParameter("Action", "GetAccessToken");
    request.addParameter("Version", "2011-06-15");

    if (getAccessTokenRequest.getDurationSeconds() != null) {
        request.addParameter("DurationSeconds",
                StringUtils.fromInteger(getAccessTokenRequest.getDurationSeconds()));
    }

    return request;
}

From source file:com.github.sjones4.youcan.youtwo.model.transform.ModifyInstanceTypeAttributeRequestMarshaller.java

License:Open Source License

@Override
public Request<ModifyInstanceTypeAttributeRequest> marshall(
        final ModifyInstanceTypeAttributeRequest modifyInstanceTypeRequest) {
    if (modifyInstanceTypeRequest == null) {
        throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }//from w w w .  j a  v  a2 s  .c  o m

    Request<ModifyInstanceTypeAttributeRequest> request = new DefaultRequest<>(modifyInstanceTypeRequest,
            "AmazonEC2");
    request.addParameter("Action", "ModifyInstanceTypeAttribute");
    request.addParameter("Version", "2013-10-15");

    if (modifyInstanceTypeRequest.getName() != null) {
        request.addParameter("Name", StringUtils.fromString(modifyInstanceTypeRequest.getName()));
    }

    if (modifyInstanceTypeRequest.getCpu() != null) {
        request.addParameter("Cpu", StringUtils.fromInteger(modifyInstanceTypeRequest.getCpu()));
    }

    if (modifyInstanceTypeRequest.getDisk() != null) {
        request.addParameter("Disk", StringUtils.fromInteger(modifyInstanceTypeRequest.getDisk()));
    }

    if (modifyInstanceTypeRequest.getMemory() != null) {
        request.addParameter("Memory", StringUtils.fromInteger(modifyInstanceTypeRequest.getMemory()));
    }

    return request;
}