com.amazonaws.services.freetier.model.DimensionValues Maven / Gradle / Ivy
Show all versions of aws-java-sdk-freetier Show documentation
/*
* 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.freetier.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains the specifications for the filters to use for your request.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DimensionValues implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the dimension that you want to filter on.
*
*/
private String key;
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*/
private java.util.List matchOptions;
/**
*
* The metadata values you can specify to filter upon, so that the results all match at least one of the specified
* values.
*
*/
private java.util.List values;
/**
*
* The name of the dimension that you want to filter on.
*
*
* @param key
* The name of the dimension that you want to filter on.
* @see Dimension
*/
public void setKey(String key) {
this.key = key;
}
/**
*
* The name of the dimension that you want to filter on.
*
*
* @return The name of the dimension that you want to filter on.
* @see Dimension
*/
public String getKey() {
return this.key;
}
/**
*
* The name of the dimension that you want to filter on.
*
*
* @param key
* The name of the dimension that you want to filter on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Dimension
*/
public DimensionValues withKey(String key) {
setKey(key);
return this;
}
/**
*
* The name of the dimension that you want to filter on.
*
*
* @param key
* The name of the dimension that you want to filter on.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Dimension
*/
public DimensionValues withKey(Dimension key) {
this.key = key.toString();
return this;
}
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*
* @return The match options that you can use to filter your results. You can specify only one of these values in
* the array.
* @see MatchOption
*/
public java.util.List getMatchOptions() {
return matchOptions;
}
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*
* @param matchOptions
* The match options that you can use to filter your results. You can specify only one of these values in the
* array.
* @see MatchOption
*/
public void setMatchOptions(java.util.Collection matchOptions) {
if (matchOptions == null) {
this.matchOptions = null;
return;
}
this.matchOptions = new java.util.ArrayList(matchOptions);
}
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMatchOptions(java.util.Collection)} or {@link #withMatchOptions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param matchOptions
* The match options that you can use to filter your results. You can specify only one of these values in the
* array.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MatchOption
*/
public DimensionValues withMatchOptions(String... matchOptions) {
if (this.matchOptions == null) {
setMatchOptions(new java.util.ArrayList(matchOptions.length));
}
for (String ele : matchOptions) {
this.matchOptions.add(ele);
}
return this;
}
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*
* @param matchOptions
* The match options that you can use to filter your results. You can specify only one of these values in the
* array.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MatchOption
*/
public DimensionValues withMatchOptions(java.util.Collection matchOptions) {
setMatchOptions(matchOptions);
return this;
}
/**
*
* The match options that you can use to filter your results. You can specify only one of these values in the array.
*
*
* @param matchOptions
* The match options that you can use to filter your results. You can specify only one of these values in the
* array.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MatchOption
*/
public DimensionValues withMatchOptions(MatchOption... matchOptions) {
java.util.ArrayList matchOptionsCopy = new java.util.ArrayList(matchOptions.length);
for (MatchOption value : matchOptions) {
matchOptionsCopy.add(value.toString());
}
if (getMatchOptions() == null) {
setMatchOptions(matchOptionsCopy);
} else {
getMatchOptions().addAll(matchOptionsCopy);
}
return this;
}
/**
*
* The metadata values you can specify to filter upon, so that the results all match at least one of the specified
* values.
*
*
* @return The metadata values you can specify to filter upon, so that the results all match at least one of the
* specified values.
*/
public java.util.List getValues() {
return values;
}
/**
*
* The metadata values you can specify to filter upon, so that the results all match at least one of the specified
* values.
*
*
* @param values
* The metadata values you can specify to filter upon, so that the results all match at least one of the
* specified values.
*/
public void setValues(java.util.Collection values) {
if (values == null) {
this.values = null;
return;
}
this.values = new java.util.ArrayList(values);
}
/**
*
* The metadata values you can specify to filter upon, so that the results all match at least one of the specified
* values.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setValues(java.util.Collection)} or {@link #withValues(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param values
* The metadata values you can specify to filter upon, so that the results all match at least one of the
* specified values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DimensionValues withValues(String... values) {
if (this.values == null) {
setValues(new java.util.ArrayList(values.length));
}
for (String ele : values) {
this.values.add(ele);
}
return this;
}
/**
*
* The metadata values you can specify to filter upon, so that the results all match at least one of the specified
* values.
*
*
* @param values
* The metadata values you can specify to filter upon, so that the results all match at least one of the
* specified values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DimensionValues withValues(java.util.Collection values) {
setValues(values);
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 (getKey() != null)
sb.append("Key: ").append(getKey()).append(",");
if (getMatchOptions() != null)
sb.append("MatchOptions: ").append(getMatchOptions()).append(",");
if (getValues() != null)
sb.append("Values: ").append(getValues());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DimensionValues == false)
return false;
DimensionValues other = (DimensionValues) obj;
if (other.getKey() == null ^ this.getKey() == null)
return false;
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false)
return false;
if (other.getMatchOptions() == null ^ this.getMatchOptions() == null)
return false;
if (other.getMatchOptions() != null && other.getMatchOptions().equals(this.getMatchOptions()) == false)
return false;
if (other.getValues() == null ^ this.getValues() == null)
return false;
if (other.getValues() != null && other.getValues().equals(this.getValues()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode());
hashCode = prime * hashCode + ((getMatchOptions() == null) ? 0 : getMatchOptions().hashCode());
hashCode = prime * hashCode + ((getValues() == null) ? 0 : getValues().hashCode());
return hashCode;
}
@Override
public DimensionValues clone() {
try {
return (DimensionValues) 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.freetier.model.transform.DimensionValuesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}