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

software.amazon.awssdk.services.lookoutmetrics.model.TimeSeriesFeedback 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.util.Arrays;
import java.util.Collections;
import java.util.List;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Details about feedback submitted for an anomalous metric. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TimeSeriesFeedback implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TIME_SERIES_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TimeSeriesId").getter(getter(TimeSeriesFeedback::timeSeriesId)).setter(setter(Builder::timeSeriesId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeSeriesId").build()).build(); private static final SdkField IS_ANOMALY_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IsAnomaly").getter(getter(TimeSeriesFeedback::isAnomaly)).setter(setter(Builder::isAnomaly)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsAnomaly").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TIME_SERIES_ID_FIELD, IS_ANOMALY_FIELD)); private static final long serialVersionUID = 1L; private final String timeSeriesId; private final Boolean isAnomaly; private TimeSeriesFeedback(BuilderImpl builder) { this.timeSeriesId = builder.timeSeriesId; this.isAnomaly = builder.isAnomaly; } /** *

* The ID of the metric. *

* * @return The ID of the metric. */ public final String timeSeriesId() { return timeSeriesId; } /** *

* Feedback on whether the metric is a legitimate anomaly. *

* * @return Feedback on whether the metric is a legitimate anomaly. */ public final Boolean isAnomaly() { return isAnomaly; } @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(timeSeriesId()); hashCode = 31 * hashCode + Objects.hashCode(isAnomaly()); 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 TimeSeriesFeedback)) { return false; } TimeSeriesFeedback other = (TimeSeriesFeedback) obj; return Objects.equals(timeSeriesId(), other.timeSeriesId()) && Objects.equals(isAnomaly(), other.isAnomaly()); } /** * 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("TimeSeriesFeedback").add("TimeSeriesId", timeSeriesId()).add("IsAnomaly", isAnomaly()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TimeSeriesId": return Optional.ofNullable(clazz.cast(timeSeriesId())); case "IsAnomaly": return Optional.ofNullable(clazz.cast(isAnomaly())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TimeSeriesFeedback) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the metric. *

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

* Feedback on whether the metric is a legitimate anomaly. *

* * @param isAnomaly * Feedback on whether the metric is a legitimate anomaly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isAnomaly(Boolean isAnomaly); } static final class BuilderImpl implements Builder { private String timeSeriesId; private Boolean isAnomaly; private BuilderImpl() { } private BuilderImpl(TimeSeriesFeedback model) { timeSeriesId(model.timeSeriesId); isAnomaly(model.isAnomaly); } public final String getTimeSeriesId() { return timeSeriesId; } public final void setTimeSeriesId(String timeSeriesId) { this.timeSeriesId = timeSeriesId; } @Override public final Builder timeSeriesId(String timeSeriesId) { this.timeSeriesId = timeSeriesId; return this; } public final Boolean getIsAnomaly() { return isAnomaly; } public final void setIsAnomaly(Boolean isAnomaly) { this.isAnomaly = isAnomaly; } @Override public final Builder isAnomaly(Boolean isAnomaly) { this.isAnomaly = isAnomaly; return this; } @Override public TimeSeriesFeedback build() { return new TimeSeriesFeedback(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy