Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.ec2.model;

A group of Amazon EC2 Reserved Instances purchased by this account.

 
 public class ReservedInstances {

    
The unique ID of the Reserved Instances purchase.
 
     private String reservedInstancesId;

    
The instance type on which the Reserved Instances can be used.

Constraints:
Allowed Values: t1.micro, m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge, cc1.4xlarge

 
     private String instanceType;

    
The Availability Zone in which the Reserved Instances can be used.
 
     private String availabilityZone;

    
The date and time the Reserved Instances started.
 
     private java.util.Date start;

    
The duration of the Reserved Instances, in seconds.
 
     private Long duration;

    
The usage price of the Reserved Instances, per hour.
 
     private Float usagePrice;

    
The purchase price of the Reserved Instances.
 
     private Float fixedPrice;

    
The number of Reserved Instances purchased.
 
     private Integer instanceCount;

    
The Reserved Instances product description (ex: Windows or Unix/Linux).
 
     private String productDescription;

    
The state of the Reserved Instances purchase.
 
     private String state;

    
A list of tags for the ReservedInstances.
 
     private java.util.List<Tagtags;

    
The unique ID of the Reserved Instances purchase.

Returns:
The unique ID of the Reserved Instances purchase.
 
     public String getReservedInstancesId() {
         return ;
     }
    
    
The unique ID of the Reserved Instances purchase.

Parameters:
reservedInstancesId The unique ID of the Reserved Instances purchase.
 
     public void setReservedInstancesId(String reservedInstancesId) {
         this. = reservedInstancesId;
     }
    
    
The unique ID of the Reserved Instances purchase.

Returns a reference to this object so that method calls can be chained together.

Parameters:
reservedInstancesId The unique ID of the Reserved Instances purchase.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withReservedInstancesId(String reservedInstancesId) {
        this. = reservedInstancesId;
        return this;
    }
    
    
    
The instance type on which the Reserved Instances can be used.

Constraints:
Allowed Values: t1.micro, m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge, cc1.4xlarge

Returns:
The instance type on which the Reserved Instances can be used.
See also:
InstanceType
    public String getInstanceType() {
        return ;
    }
    
    
The instance type on which the Reserved Instances can be used.

Constraints:
Allowed Values: t1.micro, m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge, cc1.4xlarge

Parameters:
instanceType The instance type on which the Reserved Instances can be used.
See also:
InstanceType
    public void setInstanceType(String instanceType) {
        this. = instanceType;
    }
    
    
The instance type on which the Reserved Instances can be used.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: t1.micro, m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge, cc1.4xlarge

Parameters:
instanceType The instance type on which the Reserved Instances can be used.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
    public ReservedInstances withInstanceType(String instanceType) {
        this. = instanceType;
        return this;
    }
    
    
    
The Availability Zone in which the Reserved Instances can be used.

Returns:
The Availability Zone in which the Reserved Instances can be used.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The Availability Zone in which the Reserved Instances can be used.

Parameters:
availabilityZone The Availability Zone in which the Reserved Instances can be used.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The Availability Zone in which the Reserved Instances can be used.

Returns a reference to this object so that method calls can be chained together.

Parameters:
availabilityZone The Availability Zone in which the Reserved Instances can be used.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }
    
    
    
The date and time the Reserved Instances started.

Returns:
The date and time the Reserved Instances started.
    public java.util.Date getStart() {
        return ;
    }
    
    
The date and time the Reserved Instances started.

Parameters:
start The date and time the Reserved Instances started.
    public void setStart(java.util.Date start) {
        this. = start;
    }
    
    
The date and time the Reserved Instances started.

Returns a reference to this object so that method calls can be chained together.

Parameters:
start The date and time the Reserved Instances started.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withStart(java.util.Date start) {
        this. = start;
        return this;
    }
    
    
    
The duration of the Reserved Instances, in seconds.

Returns:
The duration of the Reserved Instances, in seconds.
    public Long getDuration() {
        return ;
    }
    
    
The duration of the Reserved Instances, in seconds.

Parameters:
duration The duration of the Reserved Instances, in seconds.
    public void setDuration(Long duration) {
        this. = duration;
    }
    
    
The duration of the Reserved Instances, in seconds.

Returns a reference to this object so that method calls can be chained together.

Parameters:
duration The duration of the Reserved Instances, in seconds.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withDuration(Long duration) {
        this. = duration;
        return this;
    }
    
    
    
The usage price of the Reserved Instances, per hour.

Returns:
The usage price of the Reserved Instances, per hour.
    public Float getUsagePrice() {
        return ;
    }
    
    
The usage price of the Reserved Instances, per hour.

Parameters:
usagePrice The usage price of the Reserved Instances, per hour.
    public void setUsagePrice(Float usagePrice) {
        this. = usagePrice;
    }
    
    
The usage price of the Reserved Instances, per hour.

Returns a reference to this object so that method calls can be chained together.

Parameters:
usagePrice The usage price of the Reserved Instances, per hour.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withUsagePrice(Float usagePrice) {
        this. = usagePrice;
        return this;
    }
    
    
    
The purchase price of the Reserved Instances.

Returns:
The purchase price of the Reserved Instances.
    public Float getFixedPrice() {
        return ;
    }
    
    
The purchase price of the Reserved Instances.

Parameters:
fixedPrice The purchase price of the Reserved Instances.
    public void setFixedPrice(Float fixedPrice) {
        this. = fixedPrice;
    }
    
    
The purchase price of the Reserved Instances.

Returns a reference to this object so that method calls can be chained together.

Parameters:
fixedPrice The purchase price of the Reserved Instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withFixedPrice(Float fixedPrice) {
        this. = fixedPrice;
        return this;
    }
    
    
    
The number of Reserved Instances purchased.

Returns:
The number of Reserved Instances purchased.
    public Integer getInstanceCount() {
        return ;
    }
    
    
The number of Reserved Instances purchased.

Parameters:
instanceCount The number of Reserved Instances purchased.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
The number of Reserved Instances purchased.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceCount The number of Reserved Instances purchased.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withInstanceCount(Integer instanceCount) {
        this. = instanceCount;
        return this;
    }
    
    
    
The Reserved Instances product description (ex: Windows or Unix/Linux).

Returns:
The Reserved Instances product description (ex: Windows or Unix/Linux).
    public String getProductDescription() {
        return ;
    }
    
    
The Reserved Instances product description (ex: Windows or Unix/Linux).

Parameters:
productDescription The Reserved Instances product description (ex: Windows or Unix/Linux).
    public void setProductDescription(String productDescription) {
        this. = productDescription;
    }
    
    
The Reserved Instances product description (ex: Windows or Unix/Linux).

Returns a reference to this object so that method calls can be chained together.

Parameters:
productDescription The Reserved Instances product description (ex: Windows or Unix/Linux).
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withProductDescription(String productDescription) {
        this. = productDescription;
        return this;
    }
    
    
    
The state of the Reserved Instances purchase.

Returns:
The state of the Reserved Instances purchase.
    public String getState() {
        return ;
    }
    
    
The state of the Reserved Instances purchase.

Parameters:
state The state of the Reserved Instances purchase.
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the Reserved Instances purchase.

Returns a reference to this object so that method calls can be chained together.

Parameters:
state The state of the Reserved Instances purchase.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withState(String state) {
        this. = state;
        return this;
    }
    
    
    
A list of tags for the ReservedInstances.

Returns:
A list of tags for the ReservedInstances.
    public java.util.List<TaggetTags() {
        if ( == null) {
             = new java.util.ArrayList<Tag>();
        }
        return ;
    }
    
    
A list of tags for the ReservedInstances.

Parameters:
tags A list of tags for the ReservedInstances.
    public void setTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
    }
    
    
A list of tags for the ReservedInstances.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags A list of tags for the ReservedInstances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withTags(Tag... tags) {
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
A list of tags for the ReservedInstances.

Returns a reference to this object so that method calls can be chained together.

Parameters:
tags A list of tags for the ReservedInstances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withTags(java.util.Collection<Tagtags) {
        java.util.List<TagtagsCopy = new java.util.ArrayList<Tag>();
        if (tags != null) {
            tagsCopy.addAll(tags);
        }
        this. = tagsCopy;
        return this;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("ReservedInstancesId: " +  + ", ");
        sb.append("InstanceType: " +  + ", ");
        sb.append("AvailabilityZone: " +  + ", ");
        sb.append("Start: " +  + ", ");
        sb.append("Duration: " +  + ", ");
        sb.append("UsagePrice: " +  + ", ");
        sb.append("FixedPrice: " +  + ", ");
        sb.append("InstanceCount: " +  + ", ");
        sb.append("ProductDescription: " +  + ", ");
        sb.append("State: " +  + ", ");
        sb.append("Tags: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X