com.amazonaws.services.kinesisfirehose.model.Serializer Maven / Gradle / Ivy
Show all versions of aws-java-sdk-kinesis Show documentation
/*
* Copyright 2013-2018 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.kinesisfirehose.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The serializer that you want Kinesis Data Firehose to use to convert data to the target format before writing it to
* Amazon S3. Kinesis Data Firehose supports two types of serializers: the ORC SerDe and
* the Parquet SerDe.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Serializer implements Serializable, Cloneable, StructuredPojo {
/**
*
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*
*/
private ParquetSerDe parquetSerDe;
/**
*
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more information,
* see Apache ORC.
*
*/
private OrcSerDe orcSerDe;
/**
*
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*
*
* @param parquetSerDe
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*/
public void setParquetSerDe(ParquetSerDe parquetSerDe) {
this.parquetSerDe = parquetSerDe;
}
/**
*
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*
*
* @return A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*/
public ParquetSerDe getParquetSerDe() {
return this.parquetSerDe;
}
/**
*
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
*
*
* @param parquetSerDe
* A serializer to use for converting data to the Parquet format before storing it in Amazon S3. For more
* information, see Apache Parquet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Serializer withParquetSerDe(ParquetSerDe parquetSerDe) {
setParquetSerDe(parquetSerDe);
return this;
}
/**
*
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more information,
* see Apache ORC.
*
*
* @param orcSerDe
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more
* information, see Apache ORC.
*/
public void setOrcSerDe(OrcSerDe orcSerDe) {
this.orcSerDe = orcSerDe;
}
/**
*
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more information,
* see Apache ORC.
*
*
* @return A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more
* information, see Apache ORC.
*/
public OrcSerDe getOrcSerDe() {
return this.orcSerDe;
}
/**
*
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more information,
* see Apache ORC.
*
*
* @param orcSerDe
* A serializer to use for converting data to the ORC format before storing it in Amazon S3. For more
* information, see Apache ORC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Serializer withOrcSerDe(OrcSerDe orcSerDe) {
setOrcSerDe(orcSerDe);
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 (getParquetSerDe() != null)
sb.append("ParquetSerDe: ").append(getParquetSerDe()).append(",");
if (getOrcSerDe() != null)
sb.append("OrcSerDe: ").append(getOrcSerDe());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Serializer == false)
return false;
Serializer other = (Serializer) obj;
if (other.getParquetSerDe() == null ^ this.getParquetSerDe() == null)
return false;
if (other.getParquetSerDe() != null && other.getParquetSerDe().equals(this.getParquetSerDe()) == false)
return false;
if (other.getOrcSerDe() == null ^ this.getOrcSerDe() == null)
return false;
if (other.getOrcSerDe() != null && other.getOrcSerDe().equals(this.getOrcSerDe()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getParquetSerDe() == null) ? 0 : getParquetSerDe().hashCode());
hashCode = prime * hashCode + ((getOrcSerDe() == null) ? 0 : getOrcSerDe().hashCode());
return hashCode;
}
@Override
public Serializer clone() {
try {
return (Serializer) 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.kinesisfirehose.model.transform.SerializerMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}