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.elasticmapreduce.model;
 

Configuration defining a new instance group.

 
 public class InstanceGroupConfig implements SerializableCloneable {

    
Friendly name given to the instance group.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String name;

    
Market type of the Amazon EC2 instances used to create a cluster node.

Constraints:
Allowed Values: ON_DEMAND, SPOT

 
     private String market;

    
The role of the instance group in the cluster.

Constraints:
Allowed Values: MASTER, CORE, TASK

 
     private String instanceRole;

    
Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String bidPrice;

    
The Amazon EC2 instance type for all instances in the instance group.

Constraints:
Length: 1 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String instanceType;

    
Target number of instances for the instance group.
 
     private Integer instanceCount;

    
Default constructor for a new InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public InstanceGroupConfig() {}
    
    
Constructs a new InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
instanceRole The role of the instance group in the cluster.
instanceType The Amazon EC2 instance type for all instances in the instance group.
instanceCount Target number of instances for the instance group.
 
     public InstanceGroupConfig(String instanceRoleString instanceTypeInteger instanceCount) {
         setInstanceRole(instanceRole);
         setInstanceType(instanceType);
         setInstanceCount(instanceCount);
     }

    
Constructs a new InstanceGroupConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
instanceRole The role of the instance group in the cluster.
instanceType The Amazon EC2 instance type for all instances in the instance group.
instanceCount Target number of instances for the instance group.
    public InstanceGroupConfig(InstanceRoleType instanceRoleString instanceTypeInteger instanceCount) {
        this. = instanceRole.toString();
        this. = instanceType;
        this. = instanceCount;
    }

    
Friendly name given to the instance group.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
Friendly name given to the instance group.
    public String getName() {
        return ;
    }
    
    
Friendly name given to the instance group.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
name Friendly name given to the instance group.
    public void setName(String name) {
        this. = name;
    }
    
    
Friendly name given to the instance group.

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

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
name Friendly name given to the instance group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupConfig withName(String name) {
        this. = name;
        return this;
    }

    
Market type of the Amazon EC2 instances used to create a cluster node.

Constraints:
Allowed Values: ON_DEMAND, SPOT

Returns:
Market type of the Amazon EC2 instances used to create a cluster node.
See also:
MarketType
    public String getMarket() {
        return ;
    }
    
    
Market type of the Amazon EC2 instances used to create a cluster node.

Constraints:
Allowed Values: ON_DEMAND, SPOT

Parameters:
market Market type of the Amazon EC2 instances used to create a cluster node.
See also:
MarketType
    public void setMarket(String market) {
        this. = market;
    }
    
    
Market type of the Amazon EC2 instances used to create a cluster node.

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

Constraints:
Allowed Values: ON_DEMAND, SPOT

Parameters:
market Market type of the Amazon EC2 instances used to create a cluster node.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
MarketType
    public InstanceGroupConfig withMarket(String market) {
        this. = market;
        return this;
    }

    
Market type of the Amazon EC2 instances used to create a cluster node.

Constraints:
Allowed Values: ON_DEMAND, SPOT

Parameters:
market Market type of the Amazon EC2 instances used to create a cluster node.
See also:
MarketType
    public void setMarket(MarketType market) {
        this. = market.toString();
    }
    
    
Market type of the Amazon EC2 instances used to create a cluster node.

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

Constraints:
Allowed Values: ON_DEMAND, SPOT

Parameters:
market Market type of the Amazon EC2 instances used to create a cluster node.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
MarketType
    public InstanceGroupConfig withMarket(MarketType market) {
        this. = market.toString();
        return this;
    }

    
The role of the instance group in the cluster.

Constraints:
Allowed Values: MASTER, CORE, TASK

Returns:
The role of the instance group in the cluster.
See also:
InstanceRoleType
    public String getInstanceRole() {
        return ;
    }
    
    
The role of the instance group in the cluster.

Constraints:
Allowed Values: MASTER, CORE, TASK

Parameters:
instanceRole The role of the instance group in the cluster.
See also:
InstanceRoleType
    public void setInstanceRole(String instanceRole) {
        this. = instanceRole;
    }
    
    
The role of the instance group in the cluster.

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

Constraints:
Allowed Values: MASTER, CORE, TASK

Parameters:
instanceRole The role of the instance group in the cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceRoleType
    public InstanceGroupConfig withInstanceRole(String instanceRole) {
        this. = instanceRole;
        return this;
    }

    
The role of the instance group in the cluster.

Constraints:
Allowed Values: MASTER, CORE, TASK

Parameters:
instanceRole The role of the instance group in the cluster.
See also:
InstanceRoleType
    public void setInstanceRole(InstanceRoleType instanceRole) {
        this. = instanceRole.toString();
    }
    
    
The role of the instance group in the cluster.

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

Constraints:
Allowed Values: MASTER, CORE, TASK

Parameters:
instanceRole The role of the instance group in the cluster.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceRoleType
    public InstanceGroupConfig withInstanceRole(InstanceRoleType instanceRole) {
        this. = instanceRole.toString();
        return this;
    }

    
Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
    public String getBidPrice() {
        return ;
    }
    
    
Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
bidPrice Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
    public void setBidPrice(String bidPrice) {
        this. = bidPrice;
    }
    
    
Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.

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

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
bidPrice Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupConfig withBidPrice(String bidPrice) {
        this. = bidPrice;
        return this;
    }

    
The Amazon EC2 instance type for all instances in the instance group.

Constraints:
Length: 1 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The Amazon EC2 instance type for all instances in the instance group.
    public String getInstanceType() {
        return ;
    }
    
    
The Amazon EC2 instance type for all instances in the instance group.

Constraints:
Length: 1 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceType The Amazon EC2 instance type for all instances in the instance group.
    public void setInstanceType(String instanceType) {
        this. = instanceType;
    }
    
    
The Amazon EC2 instance type for all instances in the instance group.

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

Constraints:
Length: 1 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceType The Amazon EC2 instance type for all instances in the instance group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupConfig withInstanceType(String instanceType) {
        this. = instanceType;
        return this;
    }

    
Target number of instances for the instance group.

Returns:
Target number of instances for the instance group.
    public Integer getInstanceCount() {
        return ;
    }
    
    
Target number of instances for the instance group.

Parameters:
instanceCount Target number of instances for the instance group.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
Target number of instances for the instance group.

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

Parameters:
instanceCount Target number of instances for the instance group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupConfig withInstanceCount(Integer instanceCount) {
        this. = instanceCount;
        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 (getName() != nullsb.append("Name: " + getName() + ",");
        if (getMarket() != nullsb.append("Market: " + getMarket() + ",");
        if (getInstanceRole() != nullsb.append("InstanceRole: " + getInstanceRole() + ",");
        if (getBidPrice() != nullsb.append("BidPrice: " + getBidPrice() + ",");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getInstanceCount() != nullsb.append("InstanceCount: " + getInstanceCount() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getMarket() == null) ? 0 : getMarket().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceRole() == null) ? 0 : getInstanceRole().hashCode()); 
        hashCode = prime * hashCode + ((getBidPrice() == null) ? 0 : getBidPrice().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceGroupConfig == falsereturn false;
        InstanceGroupConfig other = (InstanceGroupConfig)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getMarket() == null ^ this.getMarket() == nullreturn false;
        if (other.getMarket() != null && other.getMarket().equals(this.getMarket()) == falsereturn false
        if (other.getInstanceRole() == null ^ this.getInstanceRole() == nullreturn false;
        if (other.getInstanceRole() != null && other.getInstanceRole().equals(this.getInstanceRole()) == falsereturn false
        if (other.getBidPrice() == null ^ this.getBidPrice() == nullreturn false;
        if (other.getBidPrice() != null && other.getBidPrice().equals(this.getBidPrice()) == falsereturn false
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getInstanceCount() == null ^ this.getInstanceCount() == nullreturn false;
        if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == falsereturn false
        return true;
    }
    
    @Override
    public InstanceGroupConfig clone() {
        try {
            return (InstanceGroupConfigsuper.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