com.amazonaws.services.textract.model.ExpenseDocument Maven / Gradle / Ivy
Show all versions of aws-java-sdk-textract Show documentation
/*
* Copyright 2016-2021 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.textract.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The structure holding all the information returned by AnalyzeExpense
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ExpenseDocument implements Serializable, Cloneable, StructuredPojo {
/**
*
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the
* second 2, and so on.
*
*/
private Integer expenseIndex;
/**
*
* Any information found outside of a table by Amazon Textract.
*
*/
private java.util.List summaryFields;
/**
*
* Information detected on each table of a document, seperated into LineItems
.
*
*/
private java.util.List lineItemGroups;
/**
*
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the
* second 2, and so on.
*
*
* @param expenseIndex
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1,
* the second 2, and so on.
*/
public void setExpenseIndex(Integer expenseIndex) {
this.expenseIndex = expenseIndex;
}
/**
*
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the
* second 2, and so on.
*
*
* @return Denotes which invoice or receipt in the document the information is coming from. First document will be
* 1, the second 2, and so on.
*/
public Integer getExpenseIndex() {
return this.expenseIndex;
}
/**
*
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the
* second 2, and so on.
*
*
* @param expenseIndex
* Denotes which invoice or receipt in the document the information is coming from. First document will be 1,
* the second 2, and so on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExpenseDocument withExpenseIndex(Integer expenseIndex) {
setExpenseIndex(expenseIndex);
return this;
}
/**
*
* Any information found outside of a table by Amazon Textract.
*
*
* @return Any information found outside of a table by Amazon Textract.
*/
public java.util.List getSummaryFields() {
return summaryFields;
}
/**
*
* Any information found outside of a table by Amazon Textract.
*
*
* @param summaryFields
* Any information found outside of a table by Amazon Textract.
*/
public void setSummaryFields(java.util.Collection summaryFields) {
if (summaryFields == null) {
this.summaryFields = null;
return;
}
this.summaryFields = new java.util.ArrayList(summaryFields);
}
/**
*
* Any information found outside of a table by Amazon Textract.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSummaryFields(java.util.Collection)} or {@link #withSummaryFields(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param summaryFields
* Any information found outside of a table by Amazon Textract.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExpenseDocument withSummaryFields(ExpenseField... summaryFields) {
if (this.summaryFields == null) {
setSummaryFields(new java.util.ArrayList(summaryFields.length));
}
for (ExpenseField ele : summaryFields) {
this.summaryFields.add(ele);
}
return this;
}
/**
*
* Any information found outside of a table by Amazon Textract.
*
*
* @param summaryFields
* Any information found outside of a table by Amazon Textract.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExpenseDocument withSummaryFields(java.util.Collection summaryFields) {
setSummaryFields(summaryFields);
return this;
}
/**
*
* Information detected on each table of a document, seperated into LineItems
.
*
*
* @return Information detected on each table of a document, seperated into LineItems
.
*/
public java.util.List getLineItemGroups() {
return lineItemGroups;
}
/**
*
* Information detected on each table of a document, seperated into LineItems
.
*
*
* @param lineItemGroups
* Information detected on each table of a document, seperated into LineItems
.
*/
public void setLineItemGroups(java.util.Collection lineItemGroups) {
if (lineItemGroups == null) {
this.lineItemGroups = null;
return;
}
this.lineItemGroups = new java.util.ArrayList(lineItemGroups);
}
/**
*
* Information detected on each table of a document, seperated into LineItems
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLineItemGroups(java.util.Collection)} or {@link #withLineItemGroups(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param lineItemGroups
* Information detected on each table of a document, seperated into LineItems
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExpenseDocument withLineItemGroups(LineItemGroup... lineItemGroups) {
if (this.lineItemGroups == null) {
setLineItemGroups(new java.util.ArrayList(lineItemGroups.length));
}
for (LineItemGroup ele : lineItemGroups) {
this.lineItemGroups.add(ele);
}
return this;
}
/**
*
* Information detected on each table of a document, seperated into LineItems
.
*
*
* @param lineItemGroups
* Information detected on each table of a document, seperated into LineItems
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExpenseDocument withLineItemGroups(java.util.Collection lineItemGroups) {
setLineItemGroups(lineItemGroups);
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 (getExpenseIndex() != null)
sb.append("ExpenseIndex: ").append(getExpenseIndex()).append(",");
if (getSummaryFields() != null)
sb.append("SummaryFields: ").append(getSummaryFields()).append(",");
if (getLineItemGroups() != null)
sb.append("LineItemGroups: ").append(getLineItemGroups());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ExpenseDocument == false)
return false;
ExpenseDocument other = (ExpenseDocument) obj;
if (other.getExpenseIndex() == null ^ this.getExpenseIndex() == null)
return false;
if (other.getExpenseIndex() != null && other.getExpenseIndex().equals(this.getExpenseIndex()) == false)
return false;
if (other.getSummaryFields() == null ^ this.getSummaryFields() == null)
return false;
if (other.getSummaryFields() != null && other.getSummaryFields().equals(this.getSummaryFields()) == false)
return false;
if (other.getLineItemGroups() == null ^ this.getLineItemGroups() == null)
return false;
if (other.getLineItemGroups() != null && other.getLineItemGroups().equals(this.getLineItemGroups()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getExpenseIndex() == null) ? 0 : getExpenseIndex().hashCode());
hashCode = prime * hashCode + ((getSummaryFields() == null) ? 0 : getSummaryFields().hashCode());
hashCode = prime * hashCode + ((getLineItemGroups() == null) ? 0 : getLineItemGroups().hashCode());
return hashCode;
}
@Override
public ExpenseDocument clone() {
try {
return (ExpenseDocument) 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.textract.model.transform.ExpenseDocumentMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}