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

* The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain. *

*/ private String transactionHash; /** *

* The blockchain network where the transaction occurred. *

*/ private String network; /** *

* The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain. *

* * @param transactionHash * The hash of the transaction. It is generated whenever a transaction is verified and added to the * blockchain. */ public void setTransactionHash(String transactionHash) { this.transactionHash = transactionHash; } /** *

* The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain. *

* * @return The hash of the transaction. It is generated whenever a transaction is verified and added to the * blockchain. */ public String getTransactionHash() { return this.transactionHash; } /** *

* The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain. *

* * @param transactionHash * The hash of the transaction. It is generated whenever a transaction is verified and added to the * blockchain. * @return Returns a reference to this object so that method calls can be chained together. */ public GetTransactionRequest withTransactionHash(String transactionHash) { setTransactionHash(transactionHash); return this; } /** *

* The blockchain network where the transaction occurred. *

* * @param network * The blockchain network where the transaction occurred. * @see QueryNetwork */ public void setNetwork(String network) { this.network = network; } /** *

* The blockchain network where the transaction occurred. *

* * @return The blockchain network where the transaction occurred. * @see QueryNetwork */ public String getNetwork() { return this.network; } /** *

* The blockchain network where the transaction occurred. *

* * @param network * The blockchain network where the transaction occurred. * @return Returns a reference to this object so that method calls can be chained together. * @see QueryNetwork */ public GetTransactionRequest withNetwork(String network) { setNetwork(network); return this; } /** *

* The blockchain network where the transaction occurred. *

* * @param network * The blockchain network where the transaction occurred. * @return Returns a reference to this object so that method calls can be chained together. * @see QueryNetwork */ public GetTransactionRequest withNetwork(QueryNetwork network) { this.network = network.toString(); 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 (getTransactionHash() != null) sb.append("TransactionHash: ").append(getTransactionHash()).append(","); if (getNetwork() != null) sb.append("Network: ").append(getNetwork()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetTransactionRequest == false) return false; GetTransactionRequest other = (GetTransactionRequest) obj; if (other.getTransactionHash() == null ^ this.getTransactionHash() == null) return false; if (other.getTransactionHash() != null && other.getTransactionHash().equals(this.getTransactionHash()) == false) return false; if (other.getNetwork() == null ^ this.getNetwork() == null) return false; if (other.getNetwork() != null && other.getNetwork().equals(this.getNetwork()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTransactionHash() == null) ? 0 : getTransactionHash().hashCode()); hashCode = prime * hashCode + ((getNetwork() == null) ? 0 : getNetwork().hashCode()); return hashCode; } @Override public GetTransactionRequest clone() { return (GetTransactionRequest) super.clone(); } }