/* * 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.kms.model; import java.io.Serializable; public class ReplicateKeyResult implements Serializable { /** *

* Displays details about the new replica key, including its Amazon Resource * Name (key ARN) and Key states of KMS keys. It also includes the ARN and Amazon Web * Services Region of its primary key and other replica keys. *

*/ private KeyMetadata replicaKeyMetadata; /** *

* The key policy of the new replica key. The value is a key policy document * in JSON format. *

*

* Constraints:
* Length: 1 - 131072
* Pattern: [ -\u00FF]+
*/ private String replicaPolicy; /** *

* The tags on the new replica key. The value is a list of tag key and tag * value pairs. *

*/ private java.util.List replicaTags = new java.util.ArrayList(); /** *

* Displays details about the new replica key, including its Amazon Resource * Name (key ARN) and Key states of KMS keys. It also includes the ARN and Amazon Web * Services Region of its primary key and other replica keys. *

* * @return

* Displays details about the new replica key, including its Amazon * Resource Name (key ARN) and Key states of KMS keys. It also includes the ARN and Amazon * Web Services Region of its primary key and other replica keys. *

*/ public KeyMetadata getReplicaKeyMetadata() { return replicaKeyMetadata; } /** *

* Displays details about the new replica key, including its Amazon Resource * Name (key ARN) and Key states of KMS keys. It also includes the ARN and Amazon Web * Services Region of its primary key and other replica keys. *

* * @param replicaKeyMetadata

* Displays details about the new replica key, including its * Amazon Resource Name (key ARN) and Key states of KMS keys. It also includes the ARN and * Amazon Web Services Region of its primary key and other * replica keys. *

*/ public void setReplicaKeyMetadata(KeyMetadata replicaKeyMetadata) { this.replicaKeyMetadata = replicaKeyMetadata; } /** *

* Displays details about the new replica key, including its Amazon Resource * Name (key ARN) and Key states of KMS keys. It also includes the ARN and Amazon Web * Services Region of its primary key and other replica keys. *

*

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

* Displays details about the new replica key, including its * Amazon Resource Name (key ARN) and Key states of KMS keys. It also includes the ARN and * Amazon Web Services Region of its primary key and other * replica keys. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicateKeyResult withReplicaKeyMetadata(KeyMetadata replicaKeyMetadata) { this.replicaKeyMetadata = replicaKeyMetadata; return this; } /** *

* The key policy of the new replica key. The value is a key policy document * in JSON format. *

*

* Constraints:
* Length: 1 - 131072
* Pattern: [ -\u00FF]+
* * @return

* The key policy of the new replica key. The value is a key policy * document in JSON format. *

*/ public String getReplicaPolicy() { return replicaPolicy; } /** *

* The key policy of the new replica key. The value is a key policy document * in JSON format. *

*

* Constraints:
* Length: 1 - 131072
* Pattern: [ -\u00FF]+
* * @param replicaPolicy

* The key policy of the new replica key. The value is a key * policy document in JSON format. *

*/ public void setReplicaPolicy(String replicaPolicy) { this.replicaPolicy = replicaPolicy; } /** *

* The key policy of the new replica key. The value is a key policy document * in JSON format. *

*

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

* Constraints:
* Length: 1 - 131072
* Pattern: [ -\u00FF]+
* * @param replicaPolicy

* The key policy of the new replica key. The value is a key * policy document in JSON format. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicateKeyResult withReplicaPolicy(String replicaPolicy) { this.replicaPolicy = replicaPolicy; return this; } /** *

* The tags on the new replica key. The value is a list of tag key and tag * value pairs. *

* * @return

* The tags on the new replica key. The value is a list of tag key * and tag value pairs. *

*/ public java.util.List getReplicaTags() { return replicaTags; } /** *

* The tags on the new replica key. The value is a list of tag key and tag * value pairs. *

* * @param replicaTags

* The tags on the new replica key. The value is a list of tag * key and tag value pairs. *

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

* The tags on the new replica key. The value is a list of tag key and tag * value pairs. *

*

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

* The tags on the new replica key. The value is a list of tag * key and tag value pairs. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicateKeyResult withReplicaTags(Tag... replicaTags) { if (getReplicaTags() == null) { this.replicaTags = new java.util.ArrayList(replicaTags.length); } for (Tag value : replicaTags) { this.replicaTags.add(value); } return this; } /** *

* The tags on the new replica key. The value is a list of tag key and tag * value pairs. *

*

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

* The tags on the new replica key. The value is a list of tag * key and tag value pairs. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ReplicateKeyResult withReplicaTags(java.util.Collection replicaTags) { setReplicaTags(replicaTags); 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 (getReplicaKeyMetadata() != null) sb.append("ReplicaKeyMetadata: " + getReplicaKeyMetadata() + ","); if (getReplicaPolicy() != null) sb.append("ReplicaPolicy: " + getReplicaPolicy() + ","); if (getReplicaTags() != null) sb.append("ReplicaTags: " + getReplicaTags()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getReplicaKeyMetadata() == null) ? 0 : getReplicaKeyMetadata().hashCode()); hashCode = prime * hashCode + ((getReplicaPolicy() == null) ? 0 : getReplicaPolicy().hashCode()); hashCode = prime * hashCode + ((getReplicaTags() == null) ? 0 : getReplicaTags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReplicateKeyResult == false) return false; ReplicateKeyResult other = (ReplicateKeyResult) obj; if (other.getReplicaKeyMetadata() == null ^ this.getReplicaKeyMetadata() == null) return false; if (other.getReplicaKeyMetadata() != null && other.getReplicaKeyMetadata().equals(this.getReplicaKeyMetadata()) == false) return false; if (other.getReplicaPolicy() == null ^ this.getReplicaPolicy() == null) return false; if (other.getReplicaPolicy() != null && other.getReplicaPolicy().equals(this.getReplicaPolicy()) == false) return false; if (other.getReplicaTags() == null ^ this.getReplicaTags() == null) return false; if (other.getReplicaTags() != null && other.getReplicaTags().equals(this.getReplicaTags()) == false) return false; return true; } }