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

software.amazon.awssdk.services.mturk.model.ReviewResultDetail Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Mechanical Turk Requester module holds the client classes that are used for communicating with Amazon Mechanical Turk Requester Service.

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.mturk.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;

/**
 * 

* This data structure is returned multiple times for each result specified in the Review Policy. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReviewResultDetail implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionId").getter(getter(ReviewResultDetail::actionId)).setter(setter(Builder::actionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionId").build()).build(); private static final SdkField SUBJECT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SubjectId").getter(getter(ReviewResultDetail::subjectId)).setter(setter(Builder::subjectId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubjectId").build()).build(); private static final SdkField SUBJECT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SubjectType").getter(getter(ReviewResultDetail::subjectType)).setter(setter(Builder::subjectType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubjectType").build()).build(); private static final SdkField QUESTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionId").getter(getter(ReviewResultDetail::questionId)).setter(setter(Builder::questionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionId").build()).build(); private static final SdkField KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Key") .getter(getter(ReviewResultDetail::key)).setter(setter(Builder::key)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Key").build()).build(); private static final SdkField VALUE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Value") .getter(getter(ReviewResultDetail::value)).setter(setter(Builder::value)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Value").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_ID_FIELD, SUBJECT_ID_FIELD, SUBJECT_TYPE_FIELD, QUESTION_ID_FIELD, KEY_FIELD, VALUE_FIELD)); private static final long serialVersionUID = 1L; private final String actionId; private final String subjectId; private final String subjectType; private final String questionId; private final String key; private final String value; private ReviewResultDetail(BuilderImpl builder) { this.actionId = builder.actionId; this.subjectId = builder.subjectId; this.subjectType = builder.subjectType; this.questionId = builder.questionId; this.key = builder.key; this.value = builder.value; } /** *

* A unique identifier of the Review action result. *

* * @return A unique identifier of the Review action result. */ public final String actionId() { return actionId; } /** *

* The HITID or AssignmentId about which this result was taken. Note that HIT-level Review Policies will often emit * results about both the HIT itself and its Assignments, while Assignment-level review policies generally only emit * results about the Assignment itself. *

* * @return The HITID or AssignmentId about which this result was taken. Note that HIT-level Review Policies will * often emit results about both the HIT itself and its Assignments, while Assignment-level review policies * generally only emit results about the Assignment itself. */ public final String subjectId() { return subjectId; } /** *

* The type of the object from the SubjectId field. *

* * @return The type of the object from the SubjectId field. */ public final String subjectType() { return subjectType; } /** *

* Specifies the QuestionId the result is describing. Depending on whether the TargetType is a HIT or Assignment * this results could specify multiple values. If TargetType is HIT and QuestionId is absent, then the result * describes results of the HIT, including the HIT agreement score. If ObjectType is Assignment and QuestionId is * absent, then the result describes the Worker's performance on the HIT. *

* * @return Specifies the QuestionId the result is describing. Depending on whether the TargetType is a HIT or * Assignment this results could specify multiple values. If TargetType is HIT and QuestionId is absent, * then the result describes results of the HIT, including the HIT agreement score. If ObjectType is * Assignment and QuestionId is absent, then the result describes the Worker's performance on the HIT. */ public final String questionId() { return questionId; } /** *

* Key identifies the particular piece of reviewed information. *

* * @return Key identifies the particular piece of reviewed information. */ public final String key() { return key; } /** *

* The values of Key provided by the review policies you have selected. *

* * @return The values of Key provided by the review policies you have selected. */ public final String value() { return value; } @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(actionId()); hashCode = 31 * hashCode + Objects.hashCode(subjectId()); hashCode = 31 * hashCode + Objects.hashCode(subjectType()); hashCode = 31 * hashCode + Objects.hashCode(questionId()); hashCode = 31 * hashCode + Objects.hashCode(key()); hashCode = 31 * hashCode + Objects.hashCode(value()); 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 ReviewResultDetail)) { return false; } ReviewResultDetail other = (ReviewResultDetail) obj; return Objects.equals(actionId(), other.actionId()) && Objects.equals(subjectId(), other.subjectId()) && Objects.equals(subjectType(), other.subjectType()) && Objects.equals(questionId(), other.questionId()) && Objects.equals(key(), other.key()) && Objects.equals(value(), other.value()); } /** * 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("ReviewResultDetail").add("ActionId", actionId()).add("SubjectId", subjectId()) .add("SubjectType", subjectType()).add("QuestionId", questionId()).add("Key", key()).add("Value", value()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ActionId": return Optional.ofNullable(clazz.cast(actionId())); case "SubjectId": return Optional.ofNullable(clazz.cast(subjectId())); case "SubjectType": return Optional.ofNullable(clazz.cast(subjectType())); case "QuestionId": return Optional.ofNullable(clazz.cast(questionId())); case "Key": return Optional.ofNullable(clazz.cast(key())); case "Value": return Optional.ofNullable(clazz.cast(value())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReviewResultDetail) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A unique identifier of the Review action result. *

* * @param actionId * A unique identifier of the Review action result. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionId(String actionId); /** *

* The HITID or AssignmentId about which this result was taken. Note that HIT-level Review Policies will often * emit results about both the HIT itself and its Assignments, while Assignment-level review policies generally * only emit results about the Assignment itself. *

* * @param subjectId * The HITID or AssignmentId about which this result was taken. Note that HIT-level Review Policies will * often emit results about both the HIT itself and its Assignments, while Assignment-level review * policies generally only emit results about the Assignment itself. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subjectId(String subjectId); /** *

* The type of the object from the SubjectId field. *

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

* Specifies the QuestionId the result is describing. Depending on whether the TargetType is a HIT or Assignment * this results could specify multiple values. If TargetType is HIT and QuestionId is absent, then the result * describes results of the HIT, including the HIT agreement score. If ObjectType is Assignment and QuestionId * is absent, then the result describes the Worker's performance on the HIT. *

* * @param questionId * Specifies the QuestionId the result is describing. Depending on whether the TargetType is a HIT or * Assignment this results could specify multiple values. If TargetType is HIT and QuestionId is absent, * then the result describes results of the HIT, including the HIT agreement score. If ObjectType is * Assignment and QuestionId is absent, then the result describes the Worker's performance on the HIT. * @return Returns a reference to this object so that method calls can be chained together. */ Builder questionId(String questionId); /** *

* Key identifies the particular piece of reviewed information. *

* * @param key * Key identifies the particular piece of reviewed information. * @return Returns a reference to this object so that method calls can be chained together. */ Builder key(String key); /** *

* The values of Key provided by the review policies you have selected. *

* * @param value * The values of Key provided by the review policies you have selected. * @return Returns a reference to this object so that method calls can be chained together. */ Builder value(String value); } static final class BuilderImpl implements Builder { private String actionId; private String subjectId; private String subjectType; private String questionId; private String key; private String value; private BuilderImpl() { } private BuilderImpl(ReviewResultDetail model) { actionId(model.actionId); subjectId(model.subjectId); subjectType(model.subjectType); questionId(model.questionId); key(model.key); value(model.value); } public final String getActionId() { return actionId; } @Override public final Builder actionId(String actionId) { this.actionId = actionId; return this; } public final void setActionId(String actionId) { this.actionId = actionId; } public final String getSubjectId() { return subjectId; } @Override public final Builder subjectId(String subjectId) { this.subjectId = subjectId; return this; } public final void setSubjectId(String subjectId) { this.subjectId = subjectId; } public final String getSubjectType() { return subjectType; } @Override public final Builder subjectType(String subjectType) { this.subjectType = subjectType; return this; } public final void setSubjectType(String subjectType) { this.subjectType = subjectType; } public final String getQuestionId() { return questionId; } @Override public final Builder questionId(String questionId) { this.questionId = questionId; return this; } public final void setQuestionId(String questionId) { this.questionId = questionId; } public final String getKey() { return key; } @Override public final Builder key(String key) { this.key = key; return this; } public final void setKey(String key) { this.key = key; } public final String getValue() { return value; } @Override public final Builder value(String value) { this.value = value; return this; } public final void setValue(String value) { this.value = value; } @Override public ReviewResultDetail build() { return new ReviewResultDetail(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy