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

software.amazon.awssdk.services.costexplorer.model.DimensionValues Maven / Gradle / Ivy

/*
 * Copyright 2013-2018 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 software.amazon.awssdk.services.costexplorer.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.services.costexplorer.transform.DimensionValuesMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The metadata that you can use to filter and group your results. You can use GetDimensionValues to find * specific values. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DimensionValues implements StructuredPojo, ToCopyableBuilder { private final String key; private final List values; private DimensionValues(BuilderImpl builder) { this.key = builder.key; this.values = builder.values; } /** *

* The names of the metadata types that you can use to filter and group your results. For example, AZ * returns a list of Availability Zones. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #key} will return * {@link Dimension#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #keyAsString}. *

* * @return The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. * @see Dimension */ public Dimension key() { return Dimension.fromValue(key); } /** *

* The names of the metadata types that you can use to filter and group your results. For example, AZ * returns a list of Availability Zones. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #key} will return * {@link Dimension#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #keyAsString}. *

* * @return The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. * @see Dimension */ public String keyAsString() { return key; } /** *

* The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. */ public List values() { return values; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(keyAsString()); hashCode = 31 * hashCode + Objects.hashCode(values()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DimensionValues)) { return false; } DimensionValues other = (DimensionValues) obj; return Objects.equals(keyAsString(), other.keyAsString()) && Objects.equals(values(), other.values()); } @Override public String toString() { return ToString.builder("DimensionValues").add("Key", keyAsString()).add("Values", values()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Key": return Optional.ofNullable(clazz.cast(keyAsString())); case "Values": return Optional.ofNullable(clazz.cast(values())); default: return Optional.empty(); } } @SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { DimensionValuesMarshaller.getInstance().marshall(this, protocolMarshaller); } public interface Builder extends CopyableBuilder { /** *

* The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. *

* * @param key * The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. * @see Dimension * @return Returns a reference to this object so that method calls can be chained together. * @see Dimension */ Builder key(String key); /** *

* The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. *

* * @param key * The names of the metadata types that you can use to filter and group your results. For example, * AZ returns a list of Availability Zones. * @see Dimension * @return Returns a reference to this object so that method calls can be chained together. * @see Dimension */ Builder key(Dimension key); /** *

* The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. *

* * @param values * The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. * @return Returns a reference to this object so that method calls can be chained together. */ Builder values(Collection values); /** *

* The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. *

* * @param values * The metadata values that you can use to filter and group your results. You can use * GetDimensionValues to find specific values. * @return Returns a reference to this object so that method calls can be chained together. */ Builder values(String... values); } static final class BuilderImpl implements Builder { private String key; private List values = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(DimensionValues model) { key(model.key); values(model.values); } public final String getKey() { return key; } @Override public final Builder key(String key) { this.key = key; return this; } @Override public final Builder key(Dimension key) { this.key(key.toString()); return this; } public final void setKey(String key) { this.key = key; } public final Collection getValues() { return values; } @Override public final Builder values(Collection values) { this.values = ValuesCopier.copy(values); return this; } @Override @SafeVarargs public final Builder values(String... values) { values(Arrays.asList(values)); return this; } public final void setValues(Collection values) { this.values = ValuesCopier.copy(values); } @Override public DimensionValues build() { return new DimensionValues(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy