software.amazon.awssdk.services.lookoutmetrics.model.DetectedCsvFormatDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lookoutmetrics Show documentation
Show all versions of lookoutmetrics Show documentation
The AWS Java SDK for Lookout Metrics module holds the client classes that are used for
communicating with Lookout Metrics.
/*
* 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.Consumer;
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;
/**
*
* Properties of an inferred CSV format.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DetectedCsvFormatDescriptor implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField FILE_COMPRESSION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("FileCompression")
.getter(getter(DetectedCsvFormatDescriptor::fileCompression)).setter(setter(Builder::fileCompression))
.constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileCompression").build()).build();
private static final SdkField CHARSET_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Charset").getter(getter(DetectedCsvFormatDescriptor::charset)).setter(setter(Builder::charset))
.constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Charset").build()).build();
private static final SdkField CONTAINS_HEADER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ContainsHeader")
.getter(getter(DetectedCsvFormatDescriptor::containsHeader)).setter(setter(Builder::containsHeader))
.constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContainsHeader").build()).build();
private static final SdkField DELIMITER_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Delimiter").getter(getter(DetectedCsvFormatDescriptor::delimiter)).setter(setter(Builder::delimiter))
.constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Delimiter").build()).build();
private static final SdkField HEADER_LIST_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("HeaderList").getter(getter(DetectedCsvFormatDescriptor::headerList)).setter(setter(Builder::headerList))
.constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HeaderList").build()).build();
private static final SdkField QUOTE_SYMBOL_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("QuoteSymbol").getter(getter(DetectedCsvFormatDescriptor::quoteSymbol))
.setter(setter(Builder::quoteSymbol)).constructor(DetectedField::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuoteSymbol").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILE_COMPRESSION_FIELD,
CHARSET_FIELD, CONTAINS_HEADER_FIELD, DELIMITER_FIELD, HEADER_LIST_FIELD, QUOTE_SYMBOL_FIELD));
private static final long serialVersionUID = 1L;
private final DetectedField fileCompression;
private final DetectedField charset;
private final DetectedField containsHeader;
private final DetectedField delimiter;
private final DetectedField headerList;
private final DetectedField quoteSymbol;
private DetectedCsvFormatDescriptor(BuilderImpl builder) {
this.fileCompression = builder.fileCompression;
this.charset = builder.charset;
this.containsHeader = builder.containsHeader;
this.delimiter = builder.delimiter;
this.headerList = builder.headerList;
this.quoteSymbol = builder.quoteSymbol;
}
/**
*
* The format's file compression.
*
*
* @return The format's file compression.
*/
public final DetectedField fileCompression() {
return fileCompression;
}
/**
*
* The format's charset.
*
*
* @return The format's charset.
*/
public final DetectedField charset() {
return charset;
}
/**
*
* Whether the format includes a header.
*
*
* @return Whether the format includes a header.
*/
public final DetectedField containsHeader() {
return containsHeader;
}
/**
*
* The format's delimiter.
*
*
* @return The format's delimiter.
*/
public final DetectedField delimiter() {
return delimiter;
}
/**
*
* The format's header list.
*
*
* @return The format's header list.
*/
public final DetectedField headerList() {
return headerList;
}
/**
*
* The format's quote symbol.
*
*
* @return The format's quote symbol.
*/
public final DetectedField quoteSymbol() {
return quoteSymbol;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(fileCompression());
hashCode = 31 * hashCode + Objects.hashCode(charset());
hashCode = 31 * hashCode + Objects.hashCode(containsHeader());
hashCode = 31 * hashCode + Objects.hashCode(delimiter());
hashCode = 31 * hashCode + Objects.hashCode(headerList());
hashCode = 31 * hashCode + Objects.hashCode(quoteSymbol());
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 DetectedCsvFormatDescriptor)) {
return false;
}
DetectedCsvFormatDescriptor other = (DetectedCsvFormatDescriptor) obj;
return Objects.equals(fileCompression(), other.fileCompression()) && Objects.equals(charset(), other.charset())
&& Objects.equals(containsHeader(), other.containsHeader()) && Objects.equals(delimiter(), other.delimiter())
&& Objects.equals(headerList(), other.headerList()) && Objects.equals(quoteSymbol(), other.quoteSymbol());
}
/**
* 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("DetectedCsvFormatDescriptor").add("FileCompression", fileCompression())
.add("Charset", charset()).add("ContainsHeader", containsHeader()).add("Delimiter", delimiter())
.add("HeaderList", headerList()).add("QuoteSymbol", quoteSymbol()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FileCompression":
return Optional.ofNullable(clazz.cast(fileCompression()));
case "Charset":
return Optional.ofNullable(clazz.cast(charset()));
case "ContainsHeader":
return Optional.ofNullable(clazz.cast(containsHeader()));
case "Delimiter":
return Optional.ofNullable(clazz.cast(delimiter()));
case "HeaderList":
return Optional.ofNullable(clazz.cast(headerList()));
case "QuoteSymbol":
return Optional.ofNullable(clazz.cast(quoteSymbol()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function