/* * 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.textract.model; import java.io.Serializable; /** *

* Contains the detections for each page analyzed through the Analyze Lending * API. *

*/ public class LendingResult implements Serializable { /** *

* The page number for a page, with regard to whole submission. *

*

* Constraints:
* Range: 0 -
*/ private Integer page; /** *

* The classifier result for a given page. *

*/ private PageClassification pageClassification; /** *

* An array of Extraction to hold structured data. e.g. normalized key value * pairs instead of raw OCR detections . *

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

* The page number for a page, with regard to whole submission. *

*

* Constraints:
* Range: 0 -
* * @return

* The page number for a page, with regard to whole submission. *

*/ public Integer getPage() { return page; } /** *

* The page number for a page, with regard to whole submission. *

*

* Constraints:
* Range: 0 -
* * @param page

* The page number for a page, with regard to whole submission. *

*/ public void setPage(Integer page) { this.page = page; } /** *

* The page number for a page, with regard to whole submission. *

*

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

* Constraints:
* Range: 0 -
* * @param page

* The page number for a page, with regard to whole submission. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LendingResult withPage(Integer page) { this.page = page; return this; } /** *

* The classifier result for a given page. *

* * @return

* The classifier result for a given page. *

*/ public PageClassification getPageClassification() { return pageClassification; } /** *

* The classifier result for a given page. *

* * @param pageClassification

* The classifier result for a given page. *

*/ public void setPageClassification(PageClassification pageClassification) { this.pageClassification = pageClassification; } /** *

* The classifier result for a given page. *

*

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

* The classifier result for a given page. *

* @return A reference to this updated object so that method calls can be * chained together. */ public LendingResult withPageClassification(PageClassification pageClassification) { this.pageClassification = pageClassification; return this; } /** *

* An array of Extraction to hold structured data. e.g. normalized key value * pairs instead of raw OCR detections . *

* * @return

* An array of Extraction to hold structured data. e.g. normalized * key value pairs instead of raw OCR detections . *

*/ public java.util.List getExtractions() { return extractions; } /** *

* An array of Extraction to hold structured data. e.g. normalized key value * pairs instead of raw OCR detections . *

* * @param extractions

* An array of Extraction to hold structured data. e.g. * normalized key value pairs instead of raw OCR detections . *

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

* An array of Extraction to hold structured data. e.g. normalized key value * pairs instead of raw OCR detections . *

*

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

* An array of Extraction to hold structured data. e.g. * normalized key value pairs instead of raw OCR detections . *

* @return A reference to this updated object so that method calls can be * chained together. */ public LendingResult withExtractions(Extraction... extractions) { if (getExtractions() == null) { this.extractions = new java.util.ArrayList(extractions.length); } for (Extraction value : extractions) { this.extractions.add(value); } return this; } /** *

* An array of Extraction to hold structured data. e.g. normalized key value * pairs instead of raw OCR detections . *

*

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

* An array of Extraction to hold structured data. e.g. * normalized key value pairs instead of raw OCR detections . *

* @return A reference to this updated object so that method calls can be * chained together. */ public LendingResult withExtractions(java.util.Collection extractions) { setExtractions(extractions); 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 (getPage() != null) sb.append("Page: " + getPage() + ","); if (getPageClassification() != null) sb.append("PageClassification: " + getPageClassification() + ","); if (getExtractions() != null) sb.append("Extractions: " + getExtractions()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPage() == null) ? 0 : getPage().hashCode()); hashCode = prime * hashCode + ((getPageClassification() == null) ? 0 : getPageClassification().hashCode()); hashCode = prime * hashCode + ((getExtractions() == null) ? 0 : getExtractions().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof LendingResult == false) return false; LendingResult other = (LendingResult) obj; if (other.getPage() == null ^ this.getPage() == null) return false; if (other.getPage() != null && other.getPage().equals(this.getPage()) == false) return false; if (other.getPageClassification() == null ^ this.getPageClassification() == null) return false; if (other.getPageClassification() != null && other.getPageClassification().equals(this.getPageClassification()) == false) return false; if (other.getExtractions() == null ^ this.getExtractions() == null) return false; if (other.getExtractions() != null && other.getExtractions().equals(this.getExtractions()) == false) return false; return true; } }