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

software.amazon.awssdk.services.lookoutmetrics.model.MetricSetSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Lookout Metrics module holds the client classes that are used for communicating with Lookout Metrics.

There is a newer version: 2.28.5
Show newest version
/*
 * Copyright 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.lookoutmetrics.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Contains information about a dataset. *

*/ @Generated("software.amazon.awssdk:codegen") public final class MetricSetSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField METRIC_SET_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MetricSetArn").getter(getter(MetricSetSummary::metricSetArn)).setter(setter(Builder::metricSetArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricSetArn").build()).build(); private static final SdkField ANOMALY_DETECTOR_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AnomalyDetectorArn").getter(getter(MetricSetSummary::anomalyDetectorArn)) .setter(setter(Builder::anomalyDetectorArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyDetectorArn").build()) .build(); private static final SdkField METRIC_SET_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MetricSetDescription").getter(getter(MetricSetSummary::metricSetDescription)) .setter(setter(Builder::metricSetDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricSetDescription").build()) .build(); private static final SdkField METRIC_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MetricSetName").getter(getter(MetricSetSummary::metricSetName)).setter(setter(Builder::metricSetName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricSetName").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(MetricSetSummary::creationTime)).setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final SdkField LAST_MODIFICATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastModificationTime").getter(getter(MetricSetSummary::lastModificationTime)) .setter(setter(Builder::lastModificationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModificationTime").build()) .build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("Tags") .getter(getter(MetricSetSummary::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(METRIC_SET_ARN_FIELD, ANOMALY_DETECTOR_ARN_FIELD, METRIC_SET_DESCRIPTION_FIELD, METRIC_SET_NAME_FIELD, CREATION_TIME_FIELD, LAST_MODIFICATION_TIME_FIELD, TAGS_FIELD)); private static final long serialVersionUID = 1L; private final String metricSetArn; private final String anomalyDetectorArn; private final String metricSetDescription; private final String metricSetName; private final Instant creationTime; private final Instant lastModificationTime; private final Map tags; private MetricSetSummary(BuilderImpl builder) { this.metricSetArn = builder.metricSetArn; this.anomalyDetectorArn = builder.anomalyDetectorArn; this.metricSetDescription = builder.metricSetDescription; this.metricSetName = builder.metricSetName; this.creationTime = builder.creationTime; this.lastModificationTime = builder.lastModificationTime; this.tags = builder.tags; } /** *

* The ARN of the dataset. *

* * @return The ARN of the dataset. */ public final String metricSetArn() { return metricSetArn; } /** *

* The ARN of the detector to which the dataset belongs. *

* * @return The ARN of the detector to which the dataset belongs. */ public final String anomalyDetectorArn() { return anomalyDetectorArn; } /** *

* The description of the dataset. *

* * @return The description of the dataset. */ public final String metricSetDescription() { return metricSetDescription; } /** *

* The name of the dataset. *

* * @return The name of the dataset. */ public final String metricSetName() { return metricSetName; } /** *

* The time at which the dataset was created. *

* * @return The time at which the dataset was created. */ public final Instant creationTime() { return creationTime; } /** *

* The time at which the dataset was last modified. *

* * @return The time at which the dataset was last modified. */ public final Instant lastModificationTime() { return lastModificationTime; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* The dataset's tags. *

*

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

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return The dataset's tags. */ public final Map tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(metricSetArn()); hashCode = 31 * hashCode + Objects.hashCode(anomalyDetectorArn()); hashCode = 31 * hashCode + Objects.hashCode(metricSetDescription()); hashCode = 31 * hashCode + Objects.hashCode(metricSetName()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModificationTime()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof MetricSetSummary)) { return false; } MetricSetSummary other = (MetricSetSummary) obj; return Objects.equals(metricSetArn(), other.metricSetArn()) && Objects.equals(anomalyDetectorArn(), other.anomalyDetectorArn()) && Objects.equals(metricSetDescription(), other.metricSetDescription()) && Objects.equals(metricSetName(), other.metricSetName()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(lastModificationTime(), other.lastModificationTime()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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. */ @Override public final String toString() { return ToString.builder("MetricSetSummary").add("MetricSetArn", metricSetArn()) .add("AnomalyDetectorArn", anomalyDetectorArn()).add("MetricSetDescription", metricSetDescription()) .add("MetricSetName", metricSetName()).add("CreationTime", creationTime()) .add("LastModificationTime", lastModificationTime()).add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MetricSetArn": return Optional.ofNullable(clazz.cast(metricSetArn())); case "AnomalyDetectorArn": return Optional.ofNullable(clazz.cast(anomalyDetectorArn())); case "MetricSetDescription": return Optional.ofNullable(clazz.cast(metricSetDescription())); case "MetricSetName": return Optional.ofNullable(clazz.cast(metricSetName())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "LastModificationTime": return Optional.ofNullable(clazz.cast(lastModificationTime())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((MetricSetSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ARN of the dataset. *

* * @param metricSetArn * The ARN of the dataset. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metricSetArn(String metricSetArn); /** *

* The ARN of the detector to which the dataset belongs. *

* * @param anomalyDetectorArn * The ARN of the detector to which the dataset belongs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder anomalyDetectorArn(String anomalyDetectorArn); /** *

* The description of the dataset. *

* * @param metricSetDescription * The description of the dataset. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metricSetDescription(String metricSetDescription); /** *

* The name of the dataset. *

* * @param metricSetName * The name of the dataset. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metricSetName(String metricSetName); /** *

* The time at which the dataset was created. *

* * @param creationTime * The time at which the dataset was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* The time at which the dataset was last modified. *

* * @param lastModificationTime * The time at which the dataset was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModificationTime(Instant lastModificationTime); /** *

* The dataset's tags. *

* * @param tags * The dataset's tags. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); } static final class BuilderImpl implements Builder { private String metricSetArn; private String anomalyDetectorArn; private String metricSetDescription; private String metricSetName; private Instant creationTime; private Instant lastModificationTime; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(MetricSetSummary model) { metricSetArn(model.metricSetArn); anomalyDetectorArn(model.anomalyDetectorArn); metricSetDescription(model.metricSetDescription); metricSetName(model.metricSetName); creationTime(model.creationTime); lastModificationTime(model.lastModificationTime); tags(model.tags); } public final String getMetricSetArn() { return metricSetArn; } public final void setMetricSetArn(String metricSetArn) { this.metricSetArn = metricSetArn; } @Override public final Builder metricSetArn(String metricSetArn) { this.metricSetArn = metricSetArn; return this; } public final String getAnomalyDetectorArn() { return anomalyDetectorArn; } public final void setAnomalyDetectorArn(String anomalyDetectorArn) { this.anomalyDetectorArn = anomalyDetectorArn; } @Override public final Builder anomalyDetectorArn(String anomalyDetectorArn) { this.anomalyDetectorArn = anomalyDetectorArn; return this; } public final String getMetricSetDescription() { return metricSetDescription; } public final void setMetricSetDescription(String metricSetDescription) { this.metricSetDescription = metricSetDescription; } @Override public final Builder metricSetDescription(String metricSetDescription) { this.metricSetDescription = metricSetDescription; return this; } public final String getMetricSetName() { return metricSetName; } public final void setMetricSetName(String metricSetName) { this.metricSetName = metricSetName; } @Override public final Builder metricSetName(String metricSetName) { this.metricSetName = metricSetName; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getLastModificationTime() { return lastModificationTime; } public final void setLastModificationTime(Instant lastModificationTime) { this.lastModificationTime = lastModificationTime; } @Override public final Builder lastModificationTime(Instant lastModificationTime) { this.lastModificationTime = lastModificationTime; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } @Override public MetricSetSummary build() { return new MetricSetSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy