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

software.amazon.awssdk.services.lookoutmetrics.model.AnomalyDetectorSummary 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.

The 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 an an anomaly detector. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AnomalyDetectorSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ANOMALY_DETECTOR_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AnomalyDetectorArn").getter(getter(AnomalyDetectorSummary::anomalyDetectorArn)) .setter(setter(Builder::anomalyDetectorArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyDetectorArn").build()) .build(); private static final SdkField ANOMALY_DETECTOR_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AnomalyDetectorName").getter(getter(AnomalyDetectorSummary::anomalyDetectorName)) .setter(setter(Builder::anomalyDetectorName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyDetectorName").build()) .build(); private static final SdkField ANOMALY_DETECTOR_DESCRIPTION_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AnomalyDetectorDescription") .getter(getter(AnomalyDetectorSummary::anomalyDetectorDescription)) .setter(setter(Builder::anomalyDetectorDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnomalyDetectorDescription").build()) .build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(AnomalyDetectorSummary::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(AnomalyDetectorSummary::lastModificationTime)) .setter(setter(Builder::lastModificationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModificationTime").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(AnomalyDetectorSummary::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("Tags") .getter(getter(AnomalyDetectorSummary::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(ANOMALY_DETECTOR_ARN_FIELD, ANOMALY_DETECTOR_NAME_FIELD, ANOMALY_DETECTOR_DESCRIPTION_FIELD, CREATION_TIME_FIELD, LAST_MODIFICATION_TIME_FIELD, STATUS_FIELD, TAGS_FIELD)); private static final long serialVersionUID = 1L; private final String anomalyDetectorArn; private final String anomalyDetectorName; private final String anomalyDetectorDescription; private final Instant creationTime; private final Instant lastModificationTime; private final String status; private final Map tags; private AnomalyDetectorSummary(BuilderImpl builder) { this.anomalyDetectorArn = builder.anomalyDetectorArn; this.anomalyDetectorName = builder.anomalyDetectorName; this.anomalyDetectorDescription = builder.anomalyDetectorDescription; this.creationTime = builder.creationTime; this.lastModificationTime = builder.lastModificationTime; this.status = builder.status; this.tags = builder.tags; } /** *

* The ARN of the detector. *

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

* The name of the detector. *

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

* A description of the detector. *

* * @return A description of the detector. */ public final String anomalyDetectorDescription() { return anomalyDetectorDescription; } /** *

* The time at which the detector was created. *

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

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

* * @return The time at which the detector was last modified. */ public final Instant lastModificationTime() { return lastModificationTime; } /** *

* The status of detector. *

*

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

* * @return The status of detector. * @see AnomalyDetectorStatus */ public final AnomalyDetectorStatus status() { return AnomalyDetectorStatus.fromValue(status); } /** *

* The status of detector. *

*

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

* * @return The status of detector. * @see AnomalyDetectorStatus */ public final String statusAsString() { return status; } /** * 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 detector'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 detector'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(anomalyDetectorArn()); hashCode = 31 * hashCode + Objects.hashCode(anomalyDetectorName()); hashCode = 31 * hashCode + Objects.hashCode(anomalyDetectorDescription()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModificationTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); 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 AnomalyDetectorSummary)) { return false; } AnomalyDetectorSummary other = (AnomalyDetectorSummary) obj; return Objects.equals(anomalyDetectorArn(), other.anomalyDetectorArn()) && Objects.equals(anomalyDetectorName(), other.anomalyDetectorName()) && Objects.equals(anomalyDetectorDescription(), other.anomalyDetectorDescription()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(lastModificationTime(), other.lastModificationTime()) && Objects.equals(statusAsString(), other.statusAsString()) && 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("AnomalyDetectorSummary").add("AnomalyDetectorArn", anomalyDetectorArn()) .add("AnomalyDetectorName", anomalyDetectorName()) .add("AnomalyDetectorDescription", anomalyDetectorDescription()).add("CreationTime", creationTime()) .add("LastModificationTime", lastModificationTime()).add("Status", statusAsString()) .add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AnomalyDetectorArn": return Optional.ofNullable(clazz.cast(anomalyDetectorArn())); case "AnomalyDetectorName": return Optional.ofNullable(clazz.cast(anomalyDetectorName())); case "AnomalyDetectorDescription": return Optional.ofNullable(clazz.cast(anomalyDetectorDescription())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "LastModificationTime": return Optional.ofNullable(clazz.cast(lastModificationTime())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); 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((AnomalyDetectorSummary) 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 detector. *

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

* The name of the detector. *

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

* A description of the detector. *

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

* The time at which the detector was created. *

* * @param creationTime * The time at which the detector 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 detector was last modified. *

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

* The status of detector. *

* * @param status * The status of detector. * @see AnomalyDetectorStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyDetectorStatus */ Builder status(String status); /** *

* The status of detector. *

* * @param status * The status of detector. * @see AnomalyDetectorStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AnomalyDetectorStatus */ Builder status(AnomalyDetectorStatus status); /** *

* The detector's tags. *

* * @param tags * The detector'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 anomalyDetectorArn; private String anomalyDetectorName; private String anomalyDetectorDescription; private Instant creationTime; private Instant lastModificationTime; private String status; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(AnomalyDetectorSummary model) { anomalyDetectorArn(model.anomalyDetectorArn); anomalyDetectorName(model.anomalyDetectorName); anomalyDetectorDescription(model.anomalyDetectorDescription); creationTime(model.creationTime); lastModificationTime(model.lastModificationTime); status(model.status); tags(model.tags); } 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 getAnomalyDetectorName() { return anomalyDetectorName; } public final void setAnomalyDetectorName(String anomalyDetectorName) { this.anomalyDetectorName = anomalyDetectorName; } @Override public final Builder anomalyDetectorName(String anomalyDetectorName) { this.anomalyDetectorName = anomalyDetectorName; return this; } public final String getAnomalyDetectorDescription() { return anomalyDetectorDescription; } public final void setAnomalyDetectorDescription(String anomalyDetectorDescription) { this.anomalyDetectorDescription = anomalyDetectorDescription; } @Override public final Builder anomalyDetectorDescription(String anomalyDetectorDescription) { this.anomalyDetectorDescription = anomalyDetectorDescription; 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 String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(AnomalyDetectorStatus status) { this.status(status == null ? null : status.toString()); 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 AnomalyDetectorSummary build() { return new AnomalyDetectorSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy