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 the configuration of a Spot fleet request.

 
 public class SpotFleetRequestConfigData implements SerializableCloneable {

    
A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
 
     private String clientToken;

    
The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.
 
     private String spotPrice;

    
The maximum number of Spot Instances to launch.
 
     private Integer targetCapacity;

    
The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
 
     private java.util.Date validFrom;

    
The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.
 
     private java.util.Date validUntil;

    
Indicates whether running instances should be terminated when the Spot fleet request expires.
 
     private Boolean terminateInstancesWithExpiration;

    
Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.
 
     private String iamFleetRole;

    
Information about the launch specifications for the instances.

Constraints:
Length: 1 -

 
A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

Returns:
A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
 
     public String getClientToken() {
         return ;
     }
    
    
A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

Parameters:
clientToken A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
    public void setClientToken(String clientToken) {
        this. = clientToken;
    }
    
    
A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.

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

Parameters:
clientToken A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

Returns:
The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.
    public String getSpotPrice() {
        return ;
    }
    
    
The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

Parameters:
spotPrice The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.
    public void setSpotPrice(String spotPrice) {
        this. = spotPrice;
    }
    
    
The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

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

Parameters:
spotPrice The maximum hourly price (bid) for any Spot Instance launched to fulfill the request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withSpotPrice(String spotPrice) {
        this. = spotPrice;
        return this;
    }

    
The maximum number of Spot Instances to launch.

Returns:
The maximum number of Spot Instances to launch.
    public Integer getTargetCapacity() {
        return ;
    }
    
    
The maximum number of Spot Instances to launch.

Parameters:
targetCapacity The maximum number of Spot Instances to launch.
    public void setTargetCapacity(Integer targetCapacity) {
        this. = targetCapacity;
    }
    
    
The maximum number of Spot Instances to launch.

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

Parameters:
targetCapacity The maximum number of Spot Instances to launch.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withTargetCapacity(Integer targetCapacity) {
        this. = targetCapacity;
        return this;
    }

    
The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.

Returns:
The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
    public java.util.Date getValidFrom() {
        return ;
    }
    
    
The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.

Parameters:
validFrom The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
    public void setValidFrom(java.util.Date validFrom) {
        this. = validFrom;
    }
    
    
The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.

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

Parameters:
validFrom The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withValidFrom(java.util.Date validFrom) {
        this. = validFrom;
        return this;
    }

    
The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.

Returns:
The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.
    public java.util.Date getValidUntil() {
        return ;
    }
    
    
The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.

Parameters:
validUntil The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.
    public void setValidUntil(java.util.Date validUntil) {
        this. = validUntil;
    }
    
    
The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.

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

Parameters:
validUntil The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot Instance requests are placed or enabled to fulfill the request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withValidUntil(java.util.Date validUntil) {
        this. = validUntil;
        return this;
    }

    
Indicates whether running instances should be terminated when the Spot fleet request expires.

Returns:
Indicates whether running instances should be terminated when the Spot fleet request expires.
        return ;
    }
    
    
Indicates whether running instances should be terminated when the Spot fleet request expires.

Parameters:
terminateInstancesWithExpiration Indicates whether running instances should be terminated when the Spot fleet request expires.
    public void setTerminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) {
        this. = terminateInstancesWithExpiration;
    }
    
    
Indicates whether running instances should be terminated when the Spot fleet request expires.

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

Parameters:
terminateInstancesWithExpiration Indicates whether running instances should be terminated when the Spot fleet request expires.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withTerminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) {
        this. = terminateInstancesWithExpiration;
        return this;
    }

    
Indicates whether running instances should be terminated when the Spot fleet request expires.

Returns:
Indicates whether running instances should be terminated when the Spot fleet request expires.
        return ;
    }

    
Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.

Returns:
Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.
    public String getIamFleetRole() {
        return ;
    }
    
    
Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.

Parameters:
iamFleetRole Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.
    public void setIamFleetRole(String iamFleetRole) {
        this. = iamFleetRole;
    }
    
    
Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.

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

Parameters:
iamFleetRole Grants the Spot fleet service permission to terminate instances on your behalf when you cancel a Spot fleet request using CancelSpotFleetRequests or when the Spot fleet request expires, if you set terminateInstancesWithExpiration.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withIamFleetRole(String iamFleetRole) {
        this. = iamFleetRole;
        return this;
    }

    
Information about the launch specifications for the instances.

Constraints:
Length: 1 -

Returns:
Information about the launch specifications for the instances.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Information about the launch specifications for the instances.

Constraints:
Length: 1 -

Parameters:
launchSpecifications Information about the launch specifications for the instances.
    public void setLaunchSpecifications(java.util.Collection<LaunchSpecificationlaunchSpecifications) {
        if (launchSpecifications == null) {
            this. = null;
            return;
        }
        launchSpecificationsCopy.addAll(launchSpecifications);
        this. = launchSpecificationsCopy;
    }
    
    
Information about the launch specifications for the instances.

NOTE: This method appends the values to the existing list (if any). Use setLaunchSpecifications(java.util.Collection) or withLaunchSpecifications(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.

Constraints:
Length: 1 -

Parameters:
launchSpecifications Information about the launch specifications for the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotFleetRequestConfigData withLaunchSpecifications(LaunchSpecification... launchSpecifications) {
        if (getLaunchSpecifications() == nullsetLaunchSpecifications(new java.util.ArrayList<LaunchSpecification>(launchSpecifications.length));
        for (LaunchSpecification value : launchSpecifications) {
            getLaunchSpecifications().add(value);
        }
        return this;
    }
    
    
Information about the launch specifications for the instances.

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

Constraints:
Length: 1 -

Parameters:
launchSpecifications Information about the launch specifications for the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (launchSpecifications == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LaunchSpecificationlaunchSpecificationsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LaunchSpecification>(launchSpecifications.size());
            launchSpecificationsCopy.addAll(launchSpecifications);
            this. = launchSpecificationsCopy;
        }
        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 (getClientToken() != nullsb.append("ClientToken: " + getClientToken() + ",");
        if (getSpotPrice() != nullsb.append("SpotPrice: " + getSpotPrice() + ",");
        if (getTargetCapacity() != nullsb.append("TargetCapacity: " + getTargetCapacity() + ",");
        if (getValidFrom() != nullsb.append("ValidFrom: " + getValidFrom() + ",");
        if (getValidUntil() != nullsb.append("ValidUntil: " + getValidUntil() + ",");
        if (isTerminateInstancesWithExpiration() != nullsb.append("TerminateInstancesWithExpiration: " + isTerminateInstancesWithExpiration() + ",");
        if (getIamFleetRole() != nullsb.append("IamFleetRole: " + getIamFleetRole() + ",");
        if (getLaunchSpecifications() != nullsb.append("LaunchSpecifications: " + getLaunchSpecifications() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        hashCode = prime * hashCode + ((getSpotPrice() == null) ? 0 : getSpotPrice().hashCode()); 
        hashCode = prime * hashCode + ((getTargetCapacity() == null) ? 0 : getTargetCapacity().hashCode()); 
        hashCode = prime * hashCode + ((getValidFrom() == null) ? 0 : getValidFrom().hashCode()); 
        hashCode = prime * hashCode + ((getValidUntil() == null) ? 0 : getValidUntil().hashCode()); 
        hashCode = prime * hashCode + ((isTerminateInstancesWithExpiration() == null) ? 0 : isTerminateInstancesWithExpiration().hashCode()); 
        hashCode = prime * hashCode + ((getIamFleetRole() == null) ? 0 : getIamFleetRole().hashCode()); 
        hashCode = prime * hashCode + ((getLaunchSpecifications() == null) ? 0 : getLaunchSpecifications().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SpotFleetRequestConfigData == falsereturn false;
        
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        if (other.getSpotPrice() == null ^ this.getSpotPrice() == nullreturn false;
        if (other.getSpotPrice() != null && other.getSpotPrice().equals(this.getSpotPrice()) == falsereturn false
        if (other.getTargetCapacity() == null ^ this.getTargetCapacity() == nullreturn false;
        if (other.getTargetCapacity() != null && other.getTargetCapacity().equals(this.getTargetCapacity()) == falsereturn false
        if (other.getValidFrom() == null ^ this.getValidFrom() == nullreturn false;
        if (other.getValidFrom() != null && other.getValidFrom().equals(this.getValidFrom()) == falsereturn false
        if (other.getValidUntil() == null ^ this.getValidUntil() == nullreturn false;
        if (other.getValidUntil() != null && other.getValidUntil().equals(this.getValidUntil()) == falsereturn false
        if (other.isTerminateInstancesWithExpiration() == null ^ this.isTerminateInstancesWithExpiration() == nullreturn false;
        if (other.isTerminateInstancesWithExpiration() != null && other.isTerminateInstancesWithExpiration().equals(this.isTerminateInstancesWithExpiration()) == falsereturn false
        if (other.getIamFleetRole() == null ^ this.getIamFleetRole() == nullreturn false;
        if (other.getIamFleetRole() != null && other.getIamFleetRole().equals(this.getIamFleetRole()) == falsereturn false
        if (other.getLaunchSpecifications() == null ^ this.getLaunchSpecifications() == nullreturn false;
        if (other.getLaunchSpecifications() != null && other.getLaunchSpecifications().equals(this.getLaunchSpecifications()) == falsereturn false
        return true;
    }
    
    @Override
    public SpotFleetRequestConfigData clone() {
        try {
            return (SpotFleetRequestConfigDatasuper.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