/* * Copyright 2010-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.rekognition.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Distributes the entries (images) in a training dataset across the training * dataset and the test dataset for a project. * DistributeDatasetEntries moves 20% of the training dataset * images to the test dataset. An entry is a JSON Line that describes an image. *

*

* You supply the Amazon Resource Names (ARN) of a project's training dataset * and test dataset. The training dataset must contain the images that you want * to split. The test dataset must be empty. The datasets must belong to the * same project. To create training and test datasets for a project, call * CreateDataset. *

*

* Distributing a dataset takes a while to complete. To check the status call * DescribeDataset. The operation is complete when the * Status field for the training dataset and the test dataset is * UPDATE_COMPLETE. If the dataset split fails, the value of * Status is UPDATE_FAILED. *

*

* This operation requires permissions to perform the * rekognition:DistributeDatasetEntries action. *

*/ public class DistributeDatasetEntriesRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The ARNS for the training dataset and test dataset that you want to use. * The datasets must belong to the same project. The test dataset must be * empty. *

*/ private java.util.List datasets; /** *

* The ARNS for the training dataset and test dataset that you want to use. * The datasets must belong to the same project. The test dataset must be * empty. *

* * @return

* The ARNS for the training dataset and test dataset that you want * to use. The datasets must belong to the same project. The test * dataset must be empty. *

*/ public java.util.List getDatasets() { return datasets; } /** *

* The ARNS for the training dataset and test dataset that you want to use. * The datasets must belong to the same project. The test dataset must be * empty. *

* * @param datasets

* The ARNS for the training dataset and test dataset that you * want to use. The datasets must belong to the same project. The * test dataset must be empty. *

*/ public void setDatasets(java.util.Collection datasets) { if (datasets == null) { this.datasets = null; return; } this.datasets = new java.util.ArrayList(datasets); } /** *

* The ARNS for the training dataset and test dataset that you want to use. * The datasets must belong to the same project. The test dataset must be * empty. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param datasets

* The ARNS for the training dataset and test dataset that you * want to use. The datasets must belong to the same project. The * test dataset must be empty. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DistributeDatasetEntriesRequest withDatasets(DistributeDataset... datasets) { if (getDatasets() == null) { this.datasets = new java.util.ArrayList(datasets.length); } for (DistributeDataset value : datasets) { this.datasets.add(value); } return this; } /** *

* The ARNS for the training dataset and test dataset that you want to use. * The datasets must belong to the same project. The test dataset must be * empty. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param datasets

* The ARNS for the training dataset and test dataset that you * want to use. The datasets must belong to the same project. The * test dataset must be empty. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DistributeDatasetEntriesRequest withDatasets( java.util.Collection datasets) { setDatasets(datasets); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDatasets() != null) sb.append("Datasets: " + getDatasets()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDatasets() == null) ? 0 : getDatasets().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DistributeDatasetEntriesRequest == false) return false; DistributeDatasetEntriesRequest other = (DistributeDatasetEntriesRequest) obj; if (other.getDatasets() == null ^ this.getDatasets() == null) return false; if (other.getDatasets() != null && other.getDatasets().equals(this.getDatasets()) == false) return false; return true; } }