
software.amazon.awssdk.services.glue.model.TaskRunProperties Maven / Gradle / Ivy
/*
* 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.glue.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;
/**
*
* The configuration properties for the task run.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TaskRunProperties implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TASK_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TaskType").getter(getter(TaskRunProperties::taskTypeAsString)).setter(setter(Builder::taskType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TaskType").build()).build();
private static final SdkField IMPORT_LABELS_TASK_RUN_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ImportLabelsTaskRunProperties")
.getter(getter(TaskRunProperties::importLabelsTaskRunProperties))
.setter(setter(Builder::importLabelsTaskRunProperties))
.constructor(ImportLabelsTaskRunProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImportLabelsTaskRunProperties")
.build()).build();
private static final SdkField EXPORT_LABELS_TASK_RUN_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ExportLabelsTaskRunProperties")
.getter(getter(TaskRunProperties::exportLabelsTaskRunProperties))
.setter(setter(Builder::exportLabelsTaskRunProperties))
.constructor(ExportLabelsTaskRunProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExportLabelsTaskRunProperties")
.build()).build();
private static final SdkField LABELING_SET_GENERATION_TASK_RUN_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("LabelingSetGenerationTaskRunProperties")
.getter(getter(TaskRunProperties::labelingSetGenerationTaskRunProperties))
.setter(setter(Builder::labelingSetGenerationTaskRunProperties))
.constructor(LabelingSetGenerationTaskRunProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("LabelingSetGenerationTaskRunProperties").build()).build();
private static final SdkField FIND_MATCHES_TASK_RUN_PROPERTIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("FindMatchesTaskRunProperties")
.getter(getter(TaskRunProperties::findMatchesTaskRunProperties))
.setter(setter(Builder::findMatchesTaskRunProperties))
.constructor(FindMatchesTaskRunProperties::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FindMatchesTaskRunProperties")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TASK_TYPE_FIELD,
IMPORT_LABELS_TASK_RUN_PROPERTIES_FIELD, EXPORT_LABELS_TASK_RUN_PROPERTIES_FIELD,
LABELING_SET_GENERATION_TASK_RUN_PROPERTIES_FIELD, FIND_MATCHES_TASK_RUN_PROPERTIES_FIELD));
private static final long serialVersionUID = 1L;
private final String taskType;
private final ImportLabelsTaskRunProperties importLabelsTaskRunProperties;
private final ExportLabelsTaskRunProperties exportLabelsTaskRunProperties;
private final LabelingSetGenerationTaskRunProperties labelingSetGenerationTaskRunProperties;
private final FindMatchesTaskRunProperties findMatchesTaskRunProperties;
private TaskRunProperties(BuilderImpl builder) {
this.taskType = builder.taskType;
this.importLabelsTaskRunProperties = builder.importLabelsTaskRunProperties;
this.exportLabelsTaskRunProperties = builder.exportLabelsTaskRunProperties;
this.labelingSetGenerationTaskRunProperties = builder.labelingSetGenerationTaskRunProperties;
this.findMatchesTaskRunProperties = builder.findMatchesTaskRunProperties;
}
/**
*
* The type of task run.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #taskType} will
* return {@link TaskType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #taskTypeAsString}.
*
*
* @return The type of task run.
* @see TaskType
*/
public final TaskType taskType() {
return TaskType.fromValue(taskType);
}
/**
*
* The type of task run.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #taskType} will
* return {@link TaskType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #taskTypeAsString}.
*
*
* @return The type of task run.
* @see TaskType
*/
public final String taskTypeAsString() {
return taskType;
}
/**
*
* The configuration properties for an importing labels task run.
*
*
* @return The configuration properties for an importing labels task run.
*/
public final ImportLabelsTaskRunProperties importLabelsTaskRunProperties() {
return importLabelsTaskRunProperties;
}
/**
*
* The configuration properties for an exporting labels task run.
*
*
* @return The configuration properties for an exporting labels task run.
*/
public final ExportLabelsTaskRunProperties exportLabelsTaskRunProperties() {
return exportLabelsTaskRunProperties;
}
/**
*
* The configuration properties for a labeling set generation task run.
*
*
* @return The configuration properties for a labeling set generation task run.
*/
public final LabelingSetGenerationTaskRunProperties labelingSetGenerationTaskRunProperties() {
return labelingSetGenerationTaskRunProperties;
}
/**
*
* The configuration properties for a find matches task run.
*
*
* @return The configuration properties for a find matches task run.
*/
public final FindMatchesTaskRunProperties findMatchesTaskRunProperties() {
return findMatchesTaskRunProperties;
}
@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(taskTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(importLabelsTaskRunProperties());
hashCode = 31 * hashCode + Objects.hashCode(exportLabelsTaskRunProperties());
hashCode = 31 * hashCode + Objects.hashCode(labelingSetGenerationTaskRunProperties());
hashCode = 31 * hashCode + Objects.hashCode(findMatchesTaskRunProperties());
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 TaskRunProperties)) {
return false;
}
TaskRunProperties other = (TaskRunProperties) obj;
return Objects.equals(taskTypeAsString(), other.taskTypeAsString())
&& Objects.equals(importLabelsTaskRunProperties(), other.importLabelsTaskRunProperties())
&& Objects.equals(exportLabelsTaskRunProperties(), other.exportLabelsTaskRunProperties())
&& Objects.equals(labelingSetGenerationTaskRunProperties(), other.labelingSetGenerationTaskRunProperties())
&& Objects.equals(findMatchesTaskRunProperties(), other.findMatchesTaskRunProperties());
}
/**
* 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("TaskRunProperties").add("TaskType", taskTypeAsString())
.add("ImportLabelsTaskRunProperties", importLabelsTaskRunProperties())
.add("ExportLabelsTaskRunProperties", exportLabelsTaskRunProperties())
.add("LabelingSetGenerationTaskRunProperties", labelingSetGenerationTaskRunProperties())
.add("FindMatchesTaskRunProperties", findMatchesTaskRunProperties()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TaskType":
return Optional.ofNullable(clazz.cast(taskTypeAsString()));
case "ImportLabelsTaskRunProperties":
return Optional.ofNullable(clazz.cast(importLabelsTaskRunProperties()));
case "ExportLabelsTaskRunProperties":
return Optional.ofNullable(clazz.cast(exportLabelsTaskRunProperties()));
case "LabelingSetGenerationTaskRunProperties":
return Optional.ofNullable(clazz.cast(labelingSetGenerationTaskRunProperties()));
case "FindMatchesTaskRunProperties":
return Optional.ofNullable(clazz.cast(findMatchesTaskRunProperties()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function