/* * 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.customerprofiles.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A class for modeling different type of tasks. Task implementation varies based on the TaskType. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Task implements Serializable, Cloneable, StructuredPojo { /** ** The operation to be performed on the provided source fields. *
*/ private ConnectorOperator connectorOperator; /** ** A field in a destination connector, or a field value against which Amazon AppFlow validates a source field. *
*/ private String destinationField; /** ** The source fields to which a particular task is applied. *
*/ private java.util.List* A map used to store task-related information. The service looks for particular information based on the TaskType. *
*/ private java.util.Map* Specifies the particular task implementation that Amazon AppFlow performs. *
*/ private String taskType; /** ** The operation to be performed on the provided source fields. *
* * @param connectorOperator * The operation to be performed on the provided source fields. */ public void setConnectorOperator(ConnectorOperator connectorOperator) { this.connectorOperator = connectorOperator; } /** ** The operation to be performed on the provided source fields. *
* * @return The operation to be performed on the provided source fields. */ public ConnectorOperator getConnectorOperator() { return this.connectorOperator; } /** ** The operation to be performed on the provided source fields. *
* * @param connectorOperator * The operation to be performed on the provided source fields. * @return Returns a reference to this object so that method calls can be chained together. */ public Task withConnectorOperator(ConnectorOperator connectorOperator) { setConnectorOperator(connectorOperator); return this; } /** ** A field in a destination connector, or a field value against which Amazon AppFlow validates a source field. *
* * @param destinationField * A field in a destination connector, or a field value against which Amazon AppFlow validates a source * field. */ public void setDestinationField(String destinationField) { this.destinationField = destinationField; } /** ** A field in a destination connector, or a field value against which Amazon AppFlow validates a source field. *
* * @return A field in a destination connector, or a field value against which Amazon AppFlow validates a source * field. */ public String getDestinationField() { return this.destinationField; } /** ** A field in a destination connector, or a field value against which Amazon AppFlow validates a source field. *
* * @param destinationField * A field in a destination connector, or a field value against which Amazon AppFlow validates a source * field. * @return Returns a reference to this object so that method calls can be chained together. */ public Task withDestinationField(String destinationField) { setDestinationField(destinationField); return this; } /** ** The source fields to which a particular task is applied. *
* * @return The source fields to which a particular task is applied. */ public java.util.List* The source fields to which a particular task is applied. *
* * @param sourceFields * The source fields to which a particular task is applied. */ public void setSourceFields(java.util.Collection* The source fields to which a particular task is applied. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setSourceFields(java.util.Collection)} or {@link #withSourceFields(java.util.Collection)} if you want to * override the existing values. *
* * @param sourceFields * The source fields to which a particular task is applied. * @return Returns a reference to this object so that method calls can be chained together. */ public Task withSourceFields(String... sourceFields) { if (this.sourceFields == null) { setSourceFields(new java.util.ArrayList* The source fields to which a particular task is applied. *
* * @param sourceFields * The source fields to which a particular task is applied. * @return Returns a reference to this object so that method calls can be chained together. */ public Task withSourceFields(java.util.Collection* A map used to store task-related information. The service looks for particular information based on the TaskType. *
* * @return A map used to store task-related information. The service looks for particular information based on the * TaskType. */ public java.util.Map* A map used to store task-related information. The service looks for particular information based on the TaskType. *
* * @param taskProperties * A map used to store task-related information. The service looks for particular information based on the * TaskType. */ public void setTaskProperties(java.util.Map* A map used to store task-related information. The service looks for particular information based on the TaskType. *
* * @param taskProperties * A map used to store task-related information. The service looks for particular information based on the * TaskType. * @return Returns a reference to this object so that method calls can be chained together. */ public Task withTaskProperties(java.util.Map* Specifies the particular task implementation that Amazon AppFlow performs. *
* * @param taskType * Specifies the particular task implementation that Amazon AppFlow performs. * @see TaskType */ public void setTaskType(String taskType) { this.taskType = taskType; } /** ** Specifies the particular task implementation that Amazon AppFlow performs. *
* * @return Specifies the particular task implementation that Amazon AppFlow performs. * @see TaskType */ public String getTaskType() { return this.taskType; } /** ** Specifies the particular task implementation that Amazon AppFlow performs. *
* * @param taskType * Specifies the particular task implementation that Amazon AppFlow performs. * @return Returns a reference to this object so that method calls can be chained together. * @see TaskType */ public Task withTaskType(String taskType) { setTaskType(taskType); return this; } /** ** Specifies the particular task implementation that Amazon AppFlow performs. *
* * @param taskType * Specifies the particular task implementation that Amazon AppFlow performs. * @return Returns a reference to this object so that method calls can be chained together. * @see TaskType */ public Task withTaskType(TaskType taskType) { this.taskType = taskType.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 (getConnectorOperator() != null) sb.append("ConnectorOperator: ").append(getConnectorOperator()).append(","); if (getDestinationField() != null) sb.append("DestinationField: ").append(getDestinationField()).append(","); if (getSourceFields() != null) sb.append("SourceFields: ").append(getSourceFields()).append(","); if (getTaskProperties() != null) sb.append("TaskProperties: ").append(getTaskProperties()).append(","); if (getTaskType() != null) sb.append("TaskType: ").append(getTaskType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Task == false) return false; Task other = (Task) obj; if (other.getConnectorOperator() == null ^ this.getConnectorOperator() == null) return false; if (other.getConnectorOperator() != null && other.getConnectorOperator().equals(this.getConnectorOperator()) == false) return false; if (other.getDestinationField() == null ^ this.getDestinationField() == null) return false; if (other.getDestinationField() != null && other.getDestinationField().equals(this.getDestinationField()) == false) return false; if (other.getSourceFields() == null ^ this.getSourceFields() == null) return false; if (other.getSourceFields() != null && other.getSourceFields().equals(this.getSourceFields()) == false) return false; if (other.getTaskProperties() == null ^ this.getTaskProperties() == null) return false; if (other.getTaskProperties() != null && other.getTaskProperties().equals(this.getTaskProperties()) == false) return false; if (other.getTaskType() == null ^ this.getTaskType() == null) return false; if (other.getTaskType() != null && other.getTaskType().equals(this.getTaskType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConnectorOperator() == null) ? 0 : getConnectorOperator().hashCode()); hashCode = prime * hashCode + ((getDestinationField() == null) ? 0 : getDestinationField().hashCode()); hashCode = prime * hashCode + ((getSourceFields() == null) ? 0 : getSourceFields().hashCode()); hashCode = prime * hashCode + ((getTaskProperties() == null) ? 0 : getTaskProperties().hashCode()); hashCode = prime * hashCode + ((getTaskType() == null) ? 0 : getTaskType().hashCode()); return hashCode; } @Override public Task clone() { try { return (Task) 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.customerprofiles.model.transform.TaskMarshaller.getInstance().marshall(this, protocolMarshaller); } }