![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.kinesisanalytics.model.DiscoverInputSchemaResult Maven / Gradle / Ivy
/*
* Copyright 2011-2016 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.kinesisanalytics.model;
import java.io.Serializable;
/**
*
*/
public class DiscoverInputSchemaResult implements Serializable, Cloneable {
/**
*
* Schema inferred from the streaming source. It identifies the format of
* the data in the streaming source and how each data element maps to
* corresponding columns in the in-application stream that you can create.
*
*/
private SourceSchema inputSchema;
/**
*
* An array of elements, where each element corresponds to a row in a stream
* record (a stream record can have more than one row).
*
*/
private java.util.List> parsedInputRecords;
/**
*
* Raw stream data that was sampled to infer the schema.
*
*/
private java.util.List rawInputRecords;
/**
*
* Schema inferred from the streaming source. It identifies the format of
* the data in the streaming source and how each data element maps to
* corresponding columns in the in-application stream that you can create.
*
*
* @param inputSchema
* Schema inferred from the streaming source. It identifies the
* format of the data in the streaming source and how each data
* element maps to corresponding columns in the in-application stream
* that you can create.
*/
public void setInputSchema(SourceSchema inputSchema) {
this.inputSchema = inputSchema;
}
/**
*
* Schema inferred from the streaming source. It identifies the format of
* the data in the streaming source and how each data element maps to
* corresponding columns in the in-application stream that you can create.
*
*
* @return Schema inferred from the streaming source. It identifies the
* format of the data in the streaming source and how each data
* element maps to corresponding columns in the in-application
* stream that you can create.
*/
public SourceSchema getInputSchema() {
return this.inputSchema;
}
/**
*
* Schema inferred from the streaming source. It identifies the format of
* the data in the streaming source and how each data element maps to
* corresponding columns in the in-application stream that you can create.
*
*
* @param inputSchema
* Schema inferred from the streaming source. It identifies the
* format of the data in the streaming source and how each data
* element maps to corresponding columns in the in-application stream
* that you can create.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DiscoverInputSchemaResult withInputSchema(SourceSchema inputSchema) {
setInputSchema(inputSchema);
return this;
}
/**
*
* An array of elements, where each element corresponds to a row in a stream
* record (a stream record can have more than one row).
*
*
* @return An array of elements, where each element corresponds to a row in
* a stream record (a stream record can have more than one row).
*/
public java.util.List> getParsedInputRecords() {
return parsedInputRecords;
}
/**
*
* An array of elements, where each element corresponds to a row in a stream
* record (a stream record can have more than one row).
*
*
* @param parsedInputRecords
* An array of elements, where each element corresponds to a row in a
* stream record (a stream record can have more than one row).
*/
public void setParsedInputRecords(
java.util.Collection> parsedInputRecords) {
if (parsedInputRecords == null) {
this.parsedInputRecords = null;
return;
}
this.parsedInputRecords = new java.util.ArrayList>(
parsedInputRecords);
}
/**
*
* An array of elements, where each element corresponds to a row in a stream
* record (a stream record can have more than one row).
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setParsedInputRecords(java.util.Collection)} or
* {@link #withParsedInputRecords(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param parsedInputRecords
* An array of elements, where each element corresponds to a row in a
* stream record (a stream record can have more than one row).
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DiscoverInputSchemaResult withParsedInputRecords(
java.util.List... parsedInputRecords) {
if (this.parsedInputRecords == null) {
setParsedInputRecords(new java.util.ArrayList>(
parsedInputRecords.length));
}
for (java.util.List ele : parsedInputRecords) {
this.parsedInputRecords.add(ele);
}
return this;
}
/**
*
* An array of elements, where each element corresponds to a row in a stream
* record (a stream record can have more than one row).
*
*
* @param parsedInputRecords
* An array of elements, where each element corresponds to a row in a
* stream record (a stream record can have more than one row).
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DiscoverInputSchemaResult withParsedInputRecords(
java.util.Collection> parsedInputRecords) {
setParsedInputRecords(parsedInputRecords);
return this;
}
/**
*
* Raw stream data that was sampled to infer the schema.
*
*
* @return Raw stream data that was sampled to infer the schema.
*/
public java.util.List getRawInputRecords() {
return rawInputRecords;
}
/**
*
* Raw stream data that was sampled to infer the schema.
*
*
* @param rawInputRecords
* Raw stream data that was sampled to infer the schema.
*/
public void setRawInputRecords(java.util.Collection rawInputRecords) {
if (rawInputRecords == null) {
this.rawInputRecords = null;
return;
}
this.rawInputRecords = new java.util.ArrayList(rawInputRecords);
}
/**
*
* Raw stream data that was sampled to infer the schema.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setRawInputRecords(java.util.Collection)} or
* {@link #withRawInputRecords(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param rawInputRecords
* Raw stream data that was sampled to infer the schema.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DiscoverInputSchemaResult withRawInputRecords(
String... rawInputRecords) {
if (this.rawInputRecords == null) {
setRawInputRecords(new java.util.ArrayList(
rawInputRecords.length));
}
for (String ele : rawInputRecords) {
this.rawInputRecords.add(ele);
}
return this;
}
/**
*
* Raw stream data that was sampled to infer the schema.
*
*
* @param rawInputRecords
* Raw stream data that was sampled to infer the schema.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public DiscoverInputSchemaResult withRawInputRecords(
java.util.Collection rawInputRecords) {
setRawInputRecords(rawInputRecords);
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 (getInputSchema() != null)
sb.append("InputSchema: " + getInputSchema() + ",");
if (getParsedInputRecords() != null)
sb.append("ParsedInputRecords: " + getParsedInputRecords() + ",");
if (getRawInputRecords() != null)
sb.append("RawInputRecords: " + getRawInputRecords());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DiscoverInputSchemaResult == false)
return false;
DiscoverInputSchemaResult other = (DiscoverInputSchemaResult) obj;
if (other.getInputSchema() == null ^ this.getInputSchema() == null)
return false;
if (other.getInputSchema() != null
&& other.getInputSchema().equals(this.getInputSchema()) == false)
return false;
if (other.getParsedInputRecords() == null
^ this.getParsedInputRecords() == null)
return false;
if (other.getParsedInputRecords() != null
&& other.getParsedInputRecords().equals(
this.getParsedInputRecords()) == false)
return false;
if (other.getRawInputRecords() == null
^ this.getRawInputRecords() == null)
return false;
if (other.getRawInputRecords() != null
&& other.getRawInputRecords().equals(this.getRawInputRecords()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime
* hashCode
+ ((getInputSchema() == null) ? 0 : getInputSchema().hashCode());
hashCode = prime
* hashCode
+ ((getParsedInputRecords() == null) ? 0
: getParsedInputRecords().hashCode());
hashCode = prime
* hashCode
+ ((getRawInputRecords() == null) ? 0 : getRawInputRecords()
.hashCode());
return hashCode;
}
@Override
public DiscoverInputSchemaResult clone() {
try {
return (DiscoverInputSchemaResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}