Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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;
  

Describes a Reserved Instance.

  
  public class ReservedInstances implements SerializableCloneable {

    
The ID of the Reserved Instance.
  
      private String reservedInstancesId;

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

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

  
      private String instanceType;

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

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

    
The time when the Reserved Instance expires.
  
      private java.util.Date end;

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

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

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

    
The number of Reserved Instances purchased.
  
      private Integer instanceCount;

    
The Reserved Instance description.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

  
      private String productDescription;

    
The state of the Reserved Instance purchase.

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

  
      private String state;

    
Any tags assigned to the resource.
  
      private com.amazonaws.internal.ListWithAutoConstructFlag<Tagtags;

    
The tenancy of the reserved instance.

Constraints:
Allowed Values: default, dedicated

 
     private String instanceTenancy;

    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

Constraints:
Allowed Values: USD

 
     private String currencyCode;

    
The Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

 
     private String offeringType;

    
The recurring charge tag assigned to the resource.
 
The ID of the Reserved Instance.

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

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

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

Parameters:
reservedInstancesId The ID of the Reserved Instance.
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 Instance can be used.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

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

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type on which the Reserved Instance can be used.
See also:
InstanceType
 
     public void setInstanceType(String instanceType) {
         this. = instanceType;
     }
    
    
The instance type on which the Reserved Instance 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.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type on which the Reserved Instance 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 instance type on which the Reserved Instance can be used.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type on which the Reserved Instance can be used.
See also:
InstanceType
 
     public void setInstanceType(InstanceType instanceType) {
         this. = instanceType.toString();
     }
    
    
The instance type on which the Reserved Instance 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.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

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

    
The Availability Zone in which the Reserved Instance can be used.

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

Parameters:
availabilityZone The Availability Zone in which the Reserved Instance can be used.
 
     public void setAvailabilityZone(String availabilityZone) {
         this. = availabilityZone;
     }
    
    
The Availability Zone in which the Reserved Instance 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 Instance 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 Instance started.

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

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

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

Parameters:
start The date and time the Reserved Instance 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 time when the Reserved Instance expires.

Returns:
The time when the Reserved Instance expires.
 
     public java.util.Date getEnd() {
         return ;
     }
    
    
The time when the Reserved Instance expires.

Parameters:
end The time when the Reserved Instance expires.
 
     public void setEnd(java.util.Date end) {
         this. = end;
     }
    
    
The time when the Reserved Instance expires.

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

Parameters:
end The time when the Reserved Instance expires.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ReservedInstances withEnd(java.util.Date end) {
         this. = end;
         return this;
     }

    
The duration of the Reserved Instance, in seconds.

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

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

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

Parameters:
duration The duration of the Reserved Instance, 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 Instance, per hour.

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

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

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

Parameters:
usagePrice The usage price of the Reserved Instance, 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 Instance.

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

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

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

Parameters:
fixedPrice The purchase price of the Reserved Instance.
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 Instance description.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Returns:
The Reserved Instance description.
See also:
RIProductDescription
 
     public String getProductDescription() {
         return ;
     }
    
    
The Reserved Instance description.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription The Reserved Instance description.
See also:
RIProductDescription
 
     public void setProductDescription(String productDescription) {
         this. = productDescription;
     }
    
    
The Reserved Instance description.

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

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription The Reserved Instance description.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RIProductDescription
 
     public ReservedInstances withProductDescription(String productDescription) {
         this. = productDescription;
         return this;
     }

    
The Reserved Instance description.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription The Reserved Instance description.
See also:
RIProductDescription
 
     public void setProductDescription(RIProductDescription productDescription) {
         this. = productDescription.toString();
     }
    
    
The Reserved Instance description.

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

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription The Reserved Instance description.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RIProductDescription
 
     public ReservedInstances withProductDescription(RIProductDescription productDescription) {
         this. = productDescription.toString();
         return this;
     }

    
The state of the Reserved Instance purchase.

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

Returns:
The state of the Reserved Instance purchase.
See also:
ReservedInstanceState
 
     public String getState() {
         return ;
     }
    
    
The state of the Reserved Instance purchase.

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

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

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

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

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

    
The state of the Reserved Instance purchase.

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

Parameters:
state The state of the Reserved Instance purchase.
See also:
ReservedInstanceState
 
     public void setState(ReservedInstanceState state) {
         this. = state.toString();
     }
    
    
The state of the Reserved Instance purchase.

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

Constraints:
Allowed Values: payment-pending, active, payment-failed, retired

Parameters:
state The state of the Reserved Instance purchase.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ReservedInstanceState
 
         this. = state.toString();
         return this;
     }

    
Any tags assigned to the resource.

Returns:
Any tags assigned to the resource.
 
     public java.util.List<TaggetTags() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
Any tags assigned to the resource.

Parameters:
tags Any tags assigned to the resource.
 
     public void setTags(java.util.Collection<Tagtags) {
         if (tags == null) {
             this. = null;
             return;
         }
         tagsCopy.addAll(tags);
         this. = tagsCopy;
     }
    
    
Any tags assigned to the resource.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(java.util.Collection) if you want to override the existing values.

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

Parameters:
tags Any tags assigned to the resource.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ReservedInstances withTags(Tag... tags) {
         if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
         for (Tag value : tags) {
             getTags().add(value);
         }
         return this;
     }
    
    
Any tags assigned to the resource.

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

Parameters:
tags Any tags assigned to the resource.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ReservedInstances withTags(java.util.Collection<Tagtags) {
         if (tags == null) {
             this. = null;
         } else {
             tagsCopy.addAll(tags);
             this. = tagsCopy;
         }
 
         return this;
     }

    
The tenancy of the reserved instance.

Constraints:
Allowed Values: default, dedicated

Returns:
The tenancy of the reserved instance.
See also:
Tenancy
 
     public String getInstanceTenancy() {
         return ;
     }
    
    
The tenancy of the reserved instance.

Constraints:
Allowed Values: default, dedicated

Parameters:
instanceTenancy The tenancy of the reserved instance.
See also:
Tenancy
 
     public void setInstanceTenancy(String instanceTenancy) {
         this. = instanceTenancy;
     }
    
    
The tenancy of the reserved instance.

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

Constraints:
Allowed Values: default, dedicated

Parameters:
instanceTenancy The tenancy of the reserved instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Tenancy
 
     public ReservedInstances withInstanceTenancy(String instanceTenancy) {
         this. = instanceTenancy;
         return this;
     }

    
The tenancy of the reserved instance.

Constraints:
Allowed Values: default, dedicated

Parameters:
instanceTenancy The tenancy of the reserved instance.
See also:
Tenancy
 
     public void setInstanceTenancy(Tenancy instanceTenancy) {
         this. = instanceTenancy.toString();
     }
    
    
The tenancy of the reserved instance.

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

Constraints:
Allowed Values: default, dedicated

Parameters:
instanceTenancy The tenancy of the reserved instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
Tenancy
 
     public ReservedInstances withInstanceTenancy(Tenancy instanceTenancy) {
         this. = instanceTenancy.toString();
         return this;
     }

    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

Constraints:
Allowed Values: USD

Returns:
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.
See also:
CurrencyCodeValues
 
     public String getCurrencyCode() {
         return ;
     }
    
    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

Constraints:
Allowed Values: USD

Parameters:
currencyCode The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.
See also:
CurrencyCodeValues
 
     public void setCurrencyCode(String currencyCode) {
         this. = currencyCode;
     }
    
    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

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

Constraints:
Allowed Values: USD

Parameters:
currencyCode The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
CurrencyCodeValues
 
     public ReservedInstances withCurrencyCode(String currencyCode) {
         this. = currencyCode;
         return this;
     }

    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

Constraints:
Allowed Values: USD

Parameters:
currencyCode The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.
See also:
CurrencyCodeValues
 
     public void setCurrencyCode(CurrencyCodeValues currencyCode) {
         this. = currencyCode.toString();
     }
    
    
The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.

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

Constraints:
Allowed Values: USD

Parameters:
currencyCode The currency of the Reserved Instance. It's specified using ISO 4217 standard currency codes. At this time, the only supported currency is USD.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
CurrencyCodeValues
 
     public ReservedInstances withCurrencyCode(CurrencyCodeValues currencyCode) {
         this. = currencyCode.toString();
         return this;
     }

    
The Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Returns:
The Reserved Instance offering type.
See also:
OfferingTypeValues
 
     public String getOfferingType() {
         return ;
     }
    
    
The Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type.
See also:
OfferingTypeValues
 
     public void setOfferingType(String offeringType) {
         this. = offeringType;
     }
    
    
The Reserved Instance offering type.

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

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OfferingTypeValues
 
     public ReservedInstances withOfferingType(String offeringType) {
         this. = offeringType;
         return this;
     }

    
The Reserved Instance offering type.

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type.
See also:
OfferingTypeValues
 
     public void setOfferingType(OfferingTypeValues offeringType) {
         this. = offeringType.toString();
     }
    
    
The Reserved Instance offering type.

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

Constraints:
Allowed Values: Heavy Utilization, Medium Utilization, Light Utilization, No Upfront, Partial Upfront, All Upfront

Parameters:
offeringType The Reserved Instance offering type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
OfferingTypeValues
 
     public ReservedInstances withOfferingType(OfferingTypeValues offeringType) {
         this. = offeringType.toString();
         return this;
     }

    
The recurring charge tag assigned to the resource.

Returns:
The recurring charge tag assigned to the resource.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The recurring charge tag assigned to the resource.

Parameters:
recurringCharges The recurring charge tag assigned to the resource.
 
     public void setRecurringCharges(java.util.Collection<RecurringChargerecurringCharges) {
         if (recurringCharges == null) {
             this. = null;
             return;
         }
         recurringChargesCopy.addAll(recurringCharges);
        this. = recurringChargesCopy;
    }
    
    
The recurring charge tag assigned to the resource.

NOTE: This method appends the values to the existing list (if any). Use setRecurringCharges(java.util.Collection) or withRecurringCharges(java.util.Collection) if you want to override the existing values.

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

Parameters:
recurringCharges The recurring charge tag assigned to the resource.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstances withRecurringCharges(RecurringCharge... recurringCharges) {
        if (getRecurringCharges() == nullsetRecurringCharges(new java.util.ArrayList<RecurringCharge>(recurringCharges.length));
        for (RecurringCharge value : recurringCharges) {
            getRecurringCharges().add(value);
        }
        return this;
    }
    
    
The recurring charge tag assigned to the resource.

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

Parameters:
recurringCharges The recurring charge tag assigned to the resource.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (recurringCharges == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<RecurringChargerecurringChargesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<RecurringCharge>(recurringCharges.size());
            recurringChargesCopy.addAll(recurringCharges);
            this. = recurringChargesCopy;
        }
        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("{");
        if (getReservedInstancesId() != nullsb.append("ReservedInstancesId: " + getReservedInstancesId() + ",");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getStart() != nullsb.append("Start: " + getStart() + ",");
        if (getEnd() != nullsb.append("End: " + getEnd() + ",");
        if (getDuration() != nullsb.append("Duration: " + getDuration() + ",");
        if (getUsagePrice() != nullsb.append("UsagePrice: " + getUsagePrice() + ",");
        if (getFixedPrice() != nullsb.append("FixedPrice: " + getFixedPrice() + ",");
        if (getInstanceCount() != nullsb.append("InstanceCount: " + getInstanceCount() + ",");
        if (getProductDescription() != nullsb.append("ProductDescription: " + getProductDescription() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() + ",");
        if (getInstanceTenancy() != nullsb.append("InstanceTenancy: " + getInstanceTenancy() + ",");
        if (getCurrencyCode() != nullsb.append("CurrencyCode: " + getCurrencyCode() + ",");
        if (getOfferingType() != nullsb.append("OfferingType: " + getOfferingType() + ",");
        if (getRecurringCharges() != nullsb.append("RecurringCharges: " + getRecurringCharges() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getReservedInstancesId() == null) ? 0 : getReservedInstancesId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getStart() == null) ? 0 : getStart().hashCode()); 
        hashCode = prime * hashCode + ((getEnd() == null) ? 0 : getEnd().hashCode()); 
        hashCode = prime * hashCode + ((getDuration() == null) ? 0 : getDuration().hashCode()); 
        hashCode = prime * hashCode + ((getUsagePrice() == null) ? 0 : getUsagePrice().hashCode()); 
        hashCode = prime * hashCode + ((getFixedPrice() == null) ? 0 : getFixedPrice().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); 
        hashCode = prime * hashCode + ((getProductDescription() == null) ? 0 : getProductDescription().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceTenancy() == null) ? 0 : getInstanceTenancy().hashCode()); 
        hashCode = prime * hashCode + ((getCurrencyCode() == null) ? 0 : getCurrencyCode().hashCode()); 
        hashCode = prime * hashCode + ((getOfferingType() == null) ? 0 : getOfferingType().hashCode()); 
        hashCode = prime * hashCode + ((getRecurringCharges() == null) ? 0 : getRecurringCharges().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ReservedInstances == falsereturn false;
        ReservedInstances other = (ReservedInstances)obj;
        
        if (other.getReservedInstancesId() == null ^ this.getReservedInstancesId() == nullreturn false;
        if (other.getReservedInstancesId() != null && other.getReservedInstancesId().equals(this.getReservedInstancesId()) == falsereturn false
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        if (other.getStart() == null ^ this.getStart() == nullreturn false;
        if (other.getStart() != null && other.getStart().equals(this.getStart()) == falsereturn false
        if (other.getEnd() == null ^ this.getEnd() == nullreturn false;
        if (other.getEnd() != null && other.getEnd().equals(this.getEnd()) == falsereturn false
        if (other.getDuration() == null ^ this.getDuration() == nullreturn false;
        if (other.getDuration() != null && other.getDuration().equals(this.getDuration()) == falsereturn false
        if (other.getUsagePrice() == null ^ this.getUsagePrice() == nullreturn false;
        if (other.getUsagePrice() != null && other.getUsagePrice().equals(this.getUsagePrice()) == falsereturn false
        if (other.getFixedPrice() == null ^ this.getFixedPrice() == nullreturn false;
        if (other.getFixedPrice() != null && other.getFixedPrice().equals(this.getFixedPrice()) == falsereturn false
        if (other.getInstanceCount() == null ^ this.getInstanceCount() == nullreturn false;
        if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == falsereturn false
        if (other.getProductDescription() == null ^ this.getProductDescription() == nullreturn false;
        if (other.getProductDescription() != null && other.getProductDescription().equals(this.getProductDescription()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        if (other.getInstanceTenancy() == null ^ this.getInstanceTenancy() == nullreturn false;
        if (other.getInstanceTenancy() != null && other.getInstanceTenancy().equals(this.getInstanceTenancy()) == falsereturn false
        if (other.getCurrencyCode() == null ^ this.getCurrencyCode() == nullreturn false;
        if (other.getCurrencyCode() != null && other.getCurrencyCode().equals(this.getCurrencyCode()) == falsereturn false
        if (other.getOfferingType() == null ^ this.getOfferingType() == nullreturn false;
        if (other.getOfferingType() != null && other.getOfferingType().equals(this.getOfferingType()) == falsereturn false
        if (other.getRecurringCharges() == null ^ this.getRecurringCharges() == nullreturn false;
        if (other.getRecurringCharges() != null && other.getRecurringCharges().equals(this.getRecurringCharges()) == falsereturn false
        return true;
    }
    
    @Override
    public ReservedInstances clone() {
        try {
            return (ReservedInstancessuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X