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

software.amazon.awssdk.services.lookoutvision.model.DatasetMetadata Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
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.lookoutvision.model;

import java.io.Serializable;
import java.time.Instant;
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;

/**
 * 

* Summary information for an Amazon Lookout for Vision dataset. For more information, see DescribeDataset and * ProjectDescription. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DatasetMetadata implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DATASET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DatasetType").getter(getter(DatasetMetadata::datasetType)).setter(setter(Builder::datasetType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatasetType").build()).build(); private static final SdkField CREATION_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTimestamp").getter(getter(DatasetMetadata::creationTimestamp)) .setter(setter(Builder::creationTimestamp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTimestamp").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(DatasetMetadata::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatusMessage").getter(getter(DatasetMetadata::statusMessage)).setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusMessage").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DATASET_TYPE_FIELD, CREATION_TIMESTAMP_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD)); private static final long serialVersionUID = 1L; private final String datasetType; private final Instant creationTimestamp; private final String status; private final String statusMessage; private DatasetMetadata(BuilderImpl builder) { this.datasetType = builder.datasetType; this.creationTimestamp = builder.creationTimestamp; this.status = builder.status; this.statusMessage = builder.statusMessage; } /** *

* The type of the dataset. *

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

* The Unix timestamp for the date and time that the dataset was created. *

* * @return The Unix timestamp for the date and time that the dataset was created. */ public final Instant creationTimestamp() { return creationTimestamp; } /** *

* The status for the dataset. *

*

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

* * @return The status for the dataset. * @see DatasetStatus */ public final DatasetStatus status() { return DatasetStatus.fromValue(status); } /** *

* The status for the dataset. *

*

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

* * @return The status for the dataset. * @see DatasetStatus */ public final String statusAsString() { return status; } /** *

* The status message for the dataset. *

* * @return The status message for the dataset. */ public final String statusMessage() { return statusMessage; } @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(datasetType()); hashCode = 31 * hashCode + Objects.hashCode(creationTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); 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 DatasetMetadata)) { return false; } DatasetMetadata other = (DatasetMetadata) obj; return Objects.equals(datasetType(), other.datasetType()) && Objects.equals(creationTimestamp(), other.creationTimestamp()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusMessage(), other.statusMessage()); } /** * 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("DatasetMetadata").add("DatasetType", datasetType()) .add("CreationTimestamp", creationTimestamp()).add("Status", statusAsString()) .add("StatusMessage", statusMessage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DatasetType": return Optional.ofNullable(clazz.cast(datasetType())); case "CreationTimestamp": return Optional.ofNullable(clazz.cast(creationTimestamp())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "StatusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DatasetMetadata) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The type of the dataset. *

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

* The Unix timestamp for the date and time that the dataset was created. *

* * @param creationTimestamp * The Unix timestamp for the date and time that the dataset was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTimestamp(Instant creationTimestamp); /** *

* The status for the dataset. *

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

* The status for the dataset. *

* * @param status * The status for the dataset. * @see DatasetStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DatasetStatus */ Builder status(DatasetStatus status); /** *

* The status message for the dataset. *

* * @param statusMessage * The status message for the dataset. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusMessage(String statusMessage); } static final class BuilderImpl implements Builder { private String datasetType; private Instant creationTimestamp; private String status; private String statusMessage; private BuilderImpl() { } private BuilderImpl(DatasetMetadata model) { datasetType(model.datasetType); creationTimestamp(model.creationTimestamp); status(model.status); statusMessage(model.statusMessage); } public final String getDatasetType() { return datasetType; } public final void setDatasetType(String datasetType) { this.datasetType = datasetType; } @Override public final Builder datasetType(String datasetType) { this.datasetType = datasetType; return this; } public final Instant getCreationTimestamp() { return creationTimestamp; } public final void setCreationTimestamp(Instant creationTimestamp) { this.creationTimestamp = creationTimestamp; } @Override public final Builder creationTimestamp(Instant creationTimestamp) { this.creationTimestamp = creationTimestamp; 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(DatasetStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusMessage() { return statusMessage; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } @Override public DatasetMetadata build() { return new DatasetMetadata(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy