public ModelPackage withTask(String task) {
        setTask(task);
        return this;
    }
<p>
The machine learning task your model package accomplishes. Common machine learning tasks include object detection
and image classification.
</p>

@param task
       The machine learning task your model package accomplishes. Common machine learning tasks include object
       detection and image classification.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/ModelPackage.java