/* * 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.comprehendmedical.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class InferRxNormResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service * sends back an HTTP 200 response, as well as the entities detected. *

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

* If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. *

*/ private String paginationToken; /** *

* The version of the model used to analyze the documents, in the format n.n.n You can use this * information to track the model used for a particular batch of documents. *

*/ private String modelVersion; /** *

* The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service * sends back an HTTP 200 response, as well as the entities detected. *

* * @return The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the * service sends back an HTTP 200 response, as well as the entities detected. */ public java.util.List getEntities() { return entities; } /** *

* The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service * sends back an HTTP 200 response, as well as the entities detected. *

* * @param entities * The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the * service sends back an HTTP 200 response, as well as the entities detected. */ public void setEntities(java.util.Collection entities) { if (entities == null) { this.entities = null; return; } this.entities = new java.util.ArrayList(entities); } /** *

* The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service * sends back an HTTP 200 response, as well as the entities detected. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setEntities(java.util.Collection)} or {@link #withEntities(java.util.Collection)} if you want to override * the existing values. *

* * @param entities * The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the * service sends back an HTTP 200 response, as well as the entities detected. * @return Returns a reference to this object so that method calls can be chained together. */ public InferRxNormResult withEntities(RxNormEntity... entities) { if (this.entities == null) { setEntities(new java.util.ArrayList(entities.length)); } for (RxNormEntity ele : entities) { this.entities.add(ele); } return this; } /** *

* The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service * sends back an HTTP 200 response, as well as the entities detected. *

* * @param entities * The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the * service sends back an HTTP 200 response, as well as the entities detected. * @return Returns a reference to this object so that method calls can be chained together. */ public InferRxNormResult withEntities(java.util.Collection entities) { setEntities(entities); return this; } /** *

* If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. *

* * @param paginationToken * If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. */ public void setPaginationToken(String paginationToken) { this.paginationToken = paginationToken; } /** *

* If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. *

* * @return If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. */ public String getPaginationToken() { return this.paginationToken; } /** *

* If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. *

* * @param paginationToken * If the result of the previous request to InferRxNorm was truncated, include the * PaginationToken to fetch the next page of medication entities. * @return Returns a reference to this object so that method calls can be chained together. */ public InferRxNormResult withPaginationToken(String paginationToken) { setPaginationToken(paginationToken); return this; } /** *

* The version of the model used to analyze the documents, in the format n.n.n You can use this * information to track the model used for a particular batch of documents. *

* * @param modelVersion * The version of the model used to analyze the documents, in the format n.n.n You can * use this information to track the model used for a particular batch of documents. */ public void setModelVersion(String modelVersion) { this.modelVersion = modelVersion; } /** *

* The version of the model used to analyze the documents, in the format n.n.n You can use this * information to track the model used for a particular batch of documents. *

* * @return The version of the model used to analyze the documents, in the format n.n.n You can * use this information to track the model used for a particular batch of documents. */ public String getModelVersion() { return this.modelVersion; } /** *

* The version of the model used to analyze the documents, in the format n.n.n You can use this * information to track the model used for a particular batch of documents. *

* * @param modelVersion * The version of the model used to analyze the documents, in the format n.n.n You can * use this information to track the model used for a particular batch of documents. * @return Returns a reference to this object so that method calls can be chained together. */ public InferRxNormResult withModelVersion(String modelVersion) { setModelVersion(modelVersion); 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 (getEntities() != null) sb.append("Entities: ").append(getEntities()).append(","); if (getPaginationToken() != null) sb.append("PaginationToken: ").append(getPaginationToken()).append(","); if (getModelVersion() != null) sb.append("ModelVersion: ").append(getModelVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof InferRxNormResult == false) return false; InferRxNormResult other = (InferRxNormResult) obj; if (other.getEntities() == null ^ this.getEntities() == null) return false; if (other.getEntities() != null && other.getEntities().equals(this.getEntities()) == false) return false; if (other.getPaginationToken() == null ^ this.getPaginationToken() == null) return false; if (other.getPaginationToken() != null && other.getPaginationToken().equals(this.getPaginationToken()) == false) return false; if (other.getModelVersion() == null ^ this.getModelVersion() == null) return false; if (other.getModelVersion() != null && other.getModelVersion().equals(this.getModelVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEntities() == null) ? 0 : getEntities().hashCode()); hashCode = prime * hashCode + ((getPaginationToken() == null) ? 0 : getPaginationToken().hashCode()); hashCode = prime * hashCode + ((getModelVersion() == null) ? 0 : getModelVersion().hashCode()); return hashCode; } @Override public InferRxNormResult clone() { try { return (InferRxNormResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }