com.amazonaws.services.mturk.model.Qualification Maven / Gradle / Ivy
/*
* Copyright 2018-2023 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 com.amazonaws.services.mturk.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The Qualification data structure represents a Qualification assigned to a user, including the Qualification type and
* the value (score).
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Qualification implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the Qualification type for the Qualification.
*
*/
private String qualificationTypeId;
/**
*
* The ID of the Worker who possesses the Qualification.
*
*/
private String workerId;
/**
*
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked, and
* then re-granted based on a new Qualification request, GrantTime is the date and time of the last call to the
* AcceptQualificationRequest operation.
*
*/
private java.util.Date grantTime;
/**
*
* The value (score) of the Qualification, if the Qualification has an integer value.
*
*/
private Integer integerValue;
private Locale localeValue;
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*/
private String status;
/**
*
* The ID of the Qualification type for the Qualification.
*
*
* @param qualificationTypeId
* The ID of the Qualification type for the Qualification.
*/
public void setQualificationTypeId(String qualificationTypeId) {
this.qualificationTypeId = qualificationTypeId;
}
/**
*
* The ID of the Qualification type for the Qualification.
*
*
* @return The ID of the Qualification type for the Qualification.
*/
public String getQualificationTypeId() {
return this.qualificationTypeId;
}
/**
*
* The ID of the Qualification type for the Qualification.
*
*
* @param qualificationTypeId
* The ID of the Qualification type for the Qualification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Qualification withQualificationTypeId(String qualificationTypeId) {
setQualificationTypeId(qualificationTypeId);
return this;
}
/**
*
* The ID of the Worker who possesses the Qualification.
*
*
* @param workerId
* The ID of the Worker who possesses the Qualification.
*/
public void setWorkerId(String workerId) {
this.workerId = workerId;
}
/**
*
* The ID of the Worker who possesses the Qualification.
*
*
* @return The ID of the Worker who possesses the Qualification.
*/
public String getWorkerId() {
return this.workerId;
}
/**
*
* The ID of the Worker who possesses the Qualification.
*
*
* @param workerId
* The ID of the Worker who possesses the Qualification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Qualification withWorkerId(String workerId) {
setWorkerId(workerId);
return this;
}
/**
*
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked, and
* then re-granted based on a new Qualification request, GrantTime is the date and time of the last call to the
* AcceptQualificationRequest operation.
*
*
* @param grantTime
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked,
* and then re-granted based on a new Qualification request, GrantTime is the date and time of the last call
* to the AcceptQualificationRequest operation.
*/
public void setGrantTime(java.util.Date grantTime) {
this.grantTime = grantTime;
}
/**
*
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked, and
* then re-granted based on a new Qualification request, GrantTime is the date and time of the last call to the
* AcceptQualificationRequest operation.
*
*
* @return The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked,
* and then re-granted based on a new Qualification request, GrantTime is the date and time of the last call
* to the AcceptQualificationRequest operation.
*/
public java.util.Date getGrantTime() {
return this.grantTime;
}
/**
*
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked, and
* then re-granted based on a new Qualification request, GrantTime is the date and time of the last call to the
* AcceptQualificationRequest operation.
*
*
* @param grantTime
* The date and time the Qualification was granted to the Worker. If the Worker's Qualification was revoked,
* and then re-granted based on a new Qualification request, GrantTime is the date and time of the last call
* to the AcceptQualificationRequest operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Qualification withGrantTime(java.util.Date grantTime) {
setGrantTime(grantTime);
return this;
}
/**
*
* The value (score) of the Qualification, if the Qualification has an integer value.
*
*
* @param integerValue
* The value (score) of the Qualification, if the Qualification has an integer value.
*/
public void setIntegerValue(Integer integerValue) {
this.integerValue = integerValue;
}
/**
*
* The value (score) of the Qualification, if the Qualification has an integer value.
*
*
* @return The value (score) of the Qualification, if the Qualification has an integer value.
*/
public Integer getIntegerValue() {
return this.integerValue;
}
/**
*
* The value (score) of the Qualification, if the Qualification has an integer value.
*
*
* @param integerValue
* The value (score) of the Qualification, if the Qualification has an integer value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Qualification withIntegerValue(Integer integerValue) {
setIntegerValue(integerValue);
return this;
}
/**
* @param localeValue
*/
public void setLocaleValue(Locale localeValue) {
this.localeValue = localeValue;
}
/**
* @return
*/
public Locale getLocaleValue() {
return this.localeValue;
}
/**
* @param localeValue
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Qualification withLocaleValue(Locale localeValue) {
setLocaleValue(localeValue);
return this;
}
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*
* @param status
* The status of the Qualification. Valid values are Granted | Revoked.
* @see QualificationStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*
* @return The status of the Qualification. Valid values are Granted | Revoked.
* @see QualificationStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*
* @param status
* The status of the Qualification. Valid values are Granted | Revoked.
* @return Returns a reference to this object so that method calls can be chained together.
* @see QualificationStatus
*/
public Qualification withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*
* @param status
* The status of the Qualification. Valid values are Granted | Revoked.
* @see QualificationStatus
*/
public void setStatus(QualificationStatus status) {
withStatus(status);
}
/**
*
* The status of the Qualification. Valid values are Granted | Revoked.
*
*
* @param status
* The status of the Qualification. Valid values are Granted | Revoked.
* @return Returns a reference to this object so that method calls can be chained together.
* @see QualificationStatus
*/
public Qualification withStatus(QualificationStatus status) {
this.status = status.toString();
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getQualificationTypeId() != null)
sb.append("QualificationTypeId: ").append(getQualificationTypeId()).append(",");
if (getWorkerId() != null)
sb.append("WorkerId: ").append(getWorkerId()).append(",");
if (getGrantTime() != null)
sb.append("GrantTime: ").append(getGrantTime()).append(",");
if (getIntegerValue() != null)
sb.append("IntegerValue: ").append(getIntegerValue()).append(",");
if (getLocaleValue() != null)
sb.append("LocaleValue: ").append(getLocaleValue()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Qualification == false)
return false;
Qualification other = (Qualification) obj;
if (other.getQualificationTypeId() == null ^ this.getQualificationTypeId() == null)
return false;
if (other.getQualificationTypeId() != null && other.getQualificationTypeId().equals(this.getQualificationTypeId()) == false)
return false;
if (other.getWorkerId() == null ^ this.getWorkerId() == null)
return false;
if (other.getWorkerId() != null && other.getWorkerId().equals(this.getWorkerId()) == false)
return false;
if (other.getGrantTime() == null ^ this.getGrantTime() == null)
return false;
if (other.getGrantTime() != null && other.getGrantTime().equals(this.getGrantTime()) == false)
return false;
if (other.getIntegerValue() == null ^ this.getIntegerValue() == null)
return false;
if (other.getIntegerValue() != null && other.getIntegerValue().equals(this.getIntegerValue()) == false)
return false;
if (other.getLocaleValue() == null ^ this.getLocaleValue() == null)
return false;
if (other.getLocaleValue() != null && other.getLocaleValue().equals(this.getLocaleValue()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getQualificationTypeId() == null) ? 0 : getQualificationTypeId().hashCode());
hashCode = prime * hashCode + ((getWorkerId() == null) ? 0 : getWorkerId().hashCode());
hashCode = prime * hashCode + ((getGrantTime() == null) ? 0 : getGrantTime().hashCode());
hashCode = prime * hashCode + ((getIntegerValue() == null) ? 0 : getIntegerValue().hashCode());
hashCode = prime * hashCode + ((getLocaleValue() == null) ? 0 : getLocaleValue().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public Qualification clone() {
try {
return (Qualification) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.mturk.model.transform.QualificationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}