/* * 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.robomaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Information about a data source. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DataSource implements Serializable, Cloneable, StructuredPojo { /** ** The name of the data source. *
*/ private String name; /** ** The S3 bucket where the data files are located. *
*/ private String s3Bucket; /** ** The list of S3 keys identifying the data source files. *
*/ private java.util.List* The data type for the data source that you're using for your container image or simulation job. You can use this * field to specify whether your data source is an Archive, an Amazon S3 prefix, or a file. *
*
* If you don't specify a field, the default value is File
.
*
* The location where your files are mounted in the container image. *
*
* If you've specified the type
of the data source as an Archive
, you must provide an
* Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the Amazon S3
* prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the Amazon S3
* path to the file that you're using as your data source.
*
* The name of the data source. *
* * @param name * The name of the data source. */ public void setName(String name) { this.name = name; } /** ** The name of the data source. *
* * @return The name of the data source. */ public String getName() { return this.name; } /** ** The name of the data source. *
* * @param name * The name of the data source. * @return Returns a reference to this object so that method calls can be chained together. */ public DataSource withName(String name) { setName(name); return this; } /** ** The S3 bucket where the data files are located. *
* * @param s3Bucket * The S3 bucket where the data files are located. */ public void setS3Bucket(String s3Bucket) { this.s3Bucket = s3Bucket; } /** ** The S3 bucket where the data files are located. *
* * @return The S3 bucket where the data files are located. */ public String getS3Bucket() { return this.s3Bucket; } /** ** The S3 bucket where the data files are located. *
* * @param s3Bucket * The S3 bucket where the data files are located. * @return Returns a reference to this object so that method calls can be chained together. */ public DataSource withS3Bucket(String s3Bucket) { setS3Bucket(s3Bucket); return this; } /** ** The list of S3 keys identifying the data source files. *
* * @return The list of S3 keys identifying the data source files. */ public java.util.List* The list of S3 keys identifying the data source files. *
* * @param s3Keys * The list of S3 keys identifying the data source files. */ public void setS3Keys(java.util.Collection* The list of S3 keys identifying the data source files. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setS3Keys(java.util.Collection)} or {@link #withS3Keys(java.util.Collection)} if you want to override the * existing values. *
* * @param s3Keys * The list of S3 keys identifying the data source files. * @return Returns a reference to this object so that method calls can be chained together. */ public DataSource withS3Keys(S3KeyOutput... s3Keys) { if (this.s3Keys == null) { setS3Keys(new java.util.ArrayList* The list of S3 keys identifying the data source files. *
* * @param s3Keys * The list of S3 keys identifying the data source files. * @return Returns a reference to this object so that method calls can be chained together. */ public DataSource withS3Keys(java.util.Collection* The data type for the data source that you're using for your container image or simulation job. You can use this * field to specify whether your data source is an Archive, an Amazon S3 prefix, or a file. *
*
* If you don't specify a field, the default value is File
.
*
* If you don't specify a field, the default value is File
.
* @see DataSourceType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The data type for the data source that you're using for your container image or simulation job. You can use this * field to specify whether your data source is an Archive, an Amazon S3 prefix, or a file. *
*
* If you don't specify a field, the default value is File
.
*
* If you don't specify a field, the default value is File
.
* @see DataSourceType
*/
public String getType() {
return this.type;
}
/**
*
* The data type for the data source that you're using for your container image or simulation job. You can use this * field to specify whether your data source is an Archive, an Amazon S3 prefix, or a file. *
*
* If you don't specify a field, the default value is File
.
*
* If you don't specify a field, the default value is File
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DataSourceType
*/
public DataSource withType(String type) {
setType(type);
return this;
}
/**
*
* The data type for the data source that you're using for your container image or simulation job. You can use this * field to specify whether your data source is an Archive, an Amazon S3 prefix, or a file. *
*
* If you don't specify a field, the default value is File
.
*
* If you don't specify a field, the default value is File
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DataSourceType
*/
public DataSource withType(DataSourceType type) {
this.type = type.toString();
return this;
}
/**
*
* The location where your files are mounted in the container image. *
*
* If you've specified the type
of the data source as an Archive
, you must provide an
* Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the Amazon S3
* prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the Amazon S3
* path to the file that you're using as your data source.
*
* If you've specified the type
of the data source as an Archive
, you must provide
* an Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the
* Amazon S3 prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the
* Amazon S3 path to the file that you're using as your data source.
*/
public void setDestination(String destination) {
this.destination = destination;
}
/**
*
* The location where your files are mounted in the container image. *
*
* If you've specified the type
of the data source as an Archive
, you must provide an
* Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the Amazon S3
* prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the Amazon S3
* path to the file that you're using as your data source.
*
* If you've specified the type
of the data source as an Archive
, you must provide
* an Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the
* Amazon S3 prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the
* Amazon S3 path to the file that you're using as your data source.
*/
public String getDestination() {
return this.destination;
}
/**
*
* The location where your files are mounted in the container image. *
*
* If you've specified the type
of the data source as an Archive
, you must provide an
* Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the Amazon S3
* prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the Amazon S3
* path to the file that you're using as your data source.
*
* If you've specified the type
of the data source as an Archive
, you must provide
* an Amazon S3 object key to your archive. The object key must point to either a .zip
or
* .tar.gz
file.
*
* If you've specified the type
of the data source as a Prefix
, you provide the
* Amazon S3 prefix that points to the files that you are using for your data source.
*
* If you've specified the type
of the data source as a File
, you provide the
* Amazon S3 path to the file that you're using as your data source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DataSource withDestination(String destination) {
setDestination(destination);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getS3Bucket() != null)
sb.append("S3Bucket: ").append(getS3Bucket()).append(",");
if (getS3Keys() != null)
sb.append("S3Keys: ").append(getS3Keys()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getDestination() != null)
sb.append("Destination: ").append(getDestination());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DataSource == false)
return false;
DataSource other = (DataSource) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getS3Bucket() == null ^ this.getS3Bucket() == null)
return false;
if (other.getS3Bucket() != null && other.getS3Bucket().equals(this.getS3Bucket()) == false)
return false;
if (other.getS3Keys() == null ^ this.getS3Keys() == null)
return false;
if (other.getS3Keys() != null && other.getS3Keys().equals(this.getS3Keys()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getDestination() == null ^ this.getDestination() == null)
return false;
if (other.getDestination() != null && other.getDestination().equals(this.getDestination()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getS3Bucket() == null) ? 0 : getS3Bucket().hashCode());
hashCode = prime * hashCode + ((getS3Keys() == null) ? 0 : getS3Keys().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode());
return hashCode;
}
@Override
public DataSource clone() {
try {
return (DataSource) 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.robomaker.model.transform.DataSourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}