Example usage for com.amazonaws.services.ec2.model InstanceStateChange setPreviousState

List of usage examples for com.amazonaws.services.ec2.model InstanceStateChange setPreviousState

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model InstanceStateChange setPreviousState.

Prototype


public void setPreviousState(InstanceState previousState) 

Source Link

Document

The previous state of the instance.

Usage

From source file:jp.primecloud.auto.aws.typica.converter.InstanceStateChangeTerminateConverter.java

License:Open Source License

@Override
protected InstanceStateChange convertObject(TerminatingInstanceDescription from) {
    InstanceStateChange to = new InstanceStateChange();

    to.setInstanceId(from.getInstanceId());

    InstanceState previousState = new InstanceState();
    previousState.setCode(from.getPreviousStateCode());
    previousState.setName(from.getPreviousState());
    to.setPreviousState(previousState);

    InstanceState currentState = new InstanceState();
    currentState.setCode(from.getShutdownStateCode());
    currentState.setName(from.getShutdownState());
    to.setCurrentState(currentState);//from w  ww .  jav a 2 s. co  m

    return to;
}