All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.computeoptimizer.model.RecommendedOptionProjectedMetric Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Compute Optimizer module holds the client classes that are used for communicating with AWS Compute Optimizer Service

The newest version!
/*
 * Copyright 2019-2024 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.computeoptimizer.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Describes a projected utilization metric of a recommendation option. *

* *

* The Cpu and Memory metrics are the only projected utilization metrics returned when you run * the GetEC2RecommendationProjectedMetrics action. Additionally, the Memory metric is returned only * for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with * the CloudWatch Agent. *

*
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RecommendedOptionProjectedMetric implements Serializable, Cloneable, StructuredPojo { /** *

* The recommended instance type. *

*/ private String recommendedInstanceType; /** *

* The rank of the recommendation option projected metric. *

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked * as 1 is related to the recommendation option that is also ranked as 1 in the same * response. *

*/ private Integer rank; /** *

* An array of objects that describe a projected utilization metric. *

*/ private java.util.List projectedMetrics; /** *

* The recommended instance type. *

* * @param recommendedInstanceType * The recommended instance type. */ public void setRecommendedInstanceType(String recommendedInstanceType) { this.recommendedInstanceType = recommendedInstanceType; } /** *

* The recommended instance type. *

* * @return The recommended instance type. */ public String getRecommendedInstanceType() { return this.recommendedInstanceType; } /** *

* The recommended instance type. *

* * @param recommendedInstanceType * The recommended instance type. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendedOptionProjectedMetric withRecommendedInstanceType(String recommendedInstanceType) { setRecommendedInstanceType(recommendedInstanceType); return this; } /** *

* The rank of the recommendation option projected metric. *

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked * as 1 is related to the recommendation option that is also ranked as 1 in the same * response. *

* * @param rank * The rank of the recommendation option projected metric.

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric * ranked as 1 is related to the recommendation option that is also ranked as 1 in * the same response. */ public void setRank(Integer rank) { this.rank = rank; } /** *

* The rank of the recommendation option projected metric. *

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked * as 1 is related to the recommendation option that is also ranked as 1 in the same * response. *

* * @return The rank of the recommendation option projected metric.

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric * ranked as 1 is related to the recommendation option that is also ranked as 1 in * the same response. */ public Integer getRank() { return this.rank; } /** *

* The rank of the recommendation option projected metric. *

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked * as 1 is related to the recommendation option that is also ranked as 1 in the same * response. *

* * @param rank * The rank of the recommendation option projected metric.

*

* The top recommendation option is ranked as 1. *

*

* The projected metric rank correlates to the recommendation option rank. For example, the projected metric * ranked as 1 is related to the recommendation option that is also ranked as 1 in * the same response. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendedOptionProjectedMetric withRank(Integer rank) { setRank(rank); return this; } /** *

* An array of objects that describe a projected utilization metric. *

* * @return An array of objects that describe a projected utilization metric. */ public java.util.List getProjectedMetrics() { return projectedMetrics; } /** *

* An array of objects that describe a projected utilization metric. *

* * @param projectedMetrics * An array of objects that describe a projected utilization metric. */ public void setProjectedMetrics(java.util.Collection projectedMetrics) { if (projectedMetrics == null) { this.projectedMetrics = null; return; } this.projectedMetrics = new java.util.ArrayList(projectedMetrics); } /** *

* An array of objects that describe a projected utilization metric. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setProjectedMetrics(java.util.Collection)} or {@link #withProjectedMetrics(java.util.Collection)} if you * want to override the existing values. *

* * @param projectedMetrics * An array of objects that describe a projected utilization metric. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendedOptionProjectedMetric withProjectedMetrics(ProjectedMetric... projectedMetrics) { if (this.projectedMetrics == null) { setProjectedMetrics(new java.util.ArrayList(projectedMetrics.length)); } for (ProjectedMetric ele : projectedMetrics) { this.projectedMetrics.add(ele); } return this; } /** *

* An array of objects that describe a projected utilization metric. *

* * @param projectedMetrics * An array of objects that describe a projected utilization metric. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendedOptionProjectedMetric withProjectedMetrics(java.util.Collection projectedMetrics) { setProjectedMetrics(projectedMetrics); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRecommendedInstanceType() != null) sb.append("RecommendedInstanceType: ").append(getRecommendedInstanceType()).append(","); if (getRank() != null) sb.append("Rank: ").append(getRank()).append(","); if (getProjectedMetrics() != null) sb.append("ProjectedMetrics: ").append(getProjectedMetrics()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RecommendedOptionProjectedMetric == false) return false; RecommendedOptionProjectedMetric other = (RecommendedOptionProjectedMetric) obj; if (other.getRecommendedInstanceType() == null ^ this.getRecommendedInstanceType() == null) return false; if (other.getRecommendedInstanceType() != null && other.getRecommendedInstanceType().equals(this.getRecommendedInstanceType()) == false) return false; if (other.getRank() == null ^ this.getRank() == null) return false; if (other.getRank() != null && other.getRank().equals(this.getRank()) == false) return false; if (other.getProjectedMetrics() == null ^ this.getProjectedMetrics() == null) return false; if (other.getProjectedMetrics() != null && other.getProjectedMetrics().equals(this.getProjectedMetrics()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRecommendedInstanceType() == null) ? 0 : getRecommendedInstanceType().hashCode()); hashCode = prime * hashCode + ((getRank() == null) ? 0 : getRank().hashCode()); hashCode = prime * hashCode + ((getProjectedMetrics() == null) ? 0 : getProjectedMetrics().hashCode()); return hashCode; } @Override public RecommendedOptionProjectedMetric clone() { try { return (RecommendedOptionProjectedMetric) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.computeoptimizer.model.transform.RecommendedOptionProjectedMetricMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy