/* * 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.managedblockchain.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Network configuration properties. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Network implements Serializable, Cloneable, StructuredPojo { /** *

* The unique identifier of the network. *

*/ private String id; /** *

* The name of the network. *

*/ private String name; /** *

* Attributes of the blockchain framework for the network. *

*/ private String description; /** *

* The blockchain framework that the network uses. *

*/ private String framework; /** *

* The version of the blockchain framework that the network uses. *

*/ private String frameworkVersion; /** *

* Attributes of the blockchain framework that the network uses. *

*/ private NetworkFrameworkAttributes frameworkAttributes; /** *

* The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint service * name to create a VPC endpoint to access network resources. *

*/ private String vpcEndpointServiceName; /** *

* The voting rules that the network uses to decide if a proposal is accepted. *

*/ private VotingPolicy votingPolicy; /** *

* The current status of the network. *

*/ private String status; /** *

* The date and time that the network was created. *

*/ private java.util.Date creationDate; /** *

* Tags assigned to the network. Each tag consists of a key and optional value. *

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

*/ private java.util.Map tags; /** *

* The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

*/ private String arn; /** *

* The unique identifier of the network. *

* * @param id * The unique identifier of the network. */ public void setId(String id) { this.id = id; } /** *

* The unique identifier of the network. *

* * @return The unique identifier of the network. */ public String getId() { return this.id; } /** *

* The unique identifier of the network. *

* * @param id * The unique identifier of the network. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withId(String id) { setId(id); return this; } /** *

* The name of the network. *

* * @param name * The name of the network. */ public void setName(String name) { this.name = name; } /** *

* The name of the network. *

* * @return The name of the network. */ public String getName() { return this.name; } /** *

* The name of the network. *

* * @param name * The name of the network. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withName(String name) { setName(name); return this; } /** *

* Attributes of the blockchain framework for the network. *

* * @param description * Attributes of the blockchain framework for the network. */ public void setDescription(String description) { this.description = description; } /** *

* Attributes of the blockchain framework for the network. *

* * @return Attributes of the blockchain framework for the network. */ public String getDescription() { return this.description; } /** *

* Attributes of the blockchain framework for the network. *

* * @param description * Attributes of the blockchain framework for the network. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withDescription(String description) { setDescription(description); return this; } /** *

* The blockchain framework that the network uses. *

* * @param framework * The blockchain framework that the network uses. * @see Framework */ public void setFramework(String framework) { this.framework = framework; } /** *

* The blockchain framework that the network uses. *

* * @return The blockchain framework that the network uses. * @see Framework */ public String getFramework() { return this.framework; } /** *

* The blockchain framework that the network uses. *

* * @param framework * The blockchain framework that the network uses. * @return Returns a reference to this object so that method calls can be chained together. * @see Framework */ public Network withFramework(String framework) { setFramework(framework); return this; } /** *

* The blockchain framework that the network uses. *

* * @param framework * The blockchain framework that the network uses. * @return Returns a reference to this object so that method calls can be chained together. * @see Framework */ public Network withFramework(Framework framework) { this.framework = framework.toString(); return this; } /** *

* The version of the blockchain framework that the network uses. *

* * @param frameworkVersion * The version of the blockchain framework that the network uses. */ public void setFrameworkVersion(String frameworkVersion) { this.frameworkVersion = frameworkVersion; } /** *

* The version of the blockchain framework that the network uses. *

* * @return The version of the blockchain framework that the network uses. */ public String getFrameworkVersion() { return this.frameworkVersion; } /** *

* The version of the blockchain framework that the network uses. *

* * @param frameworkVersion * The version of the blockchain framework that the network uses. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withFrameworkVersion(String frameworkVersion) { setFrameworkVersion(frameworkVersion); return this; } /** *

* Attributes of the blockchain framework that the network uses. *

* * @param frameworkAttributes * Attributes of the blockchain framework that the network uses. */ public void setFrameworkAttributes(NetworkFrameworkAttributes frameworkAttributes) { this.frameworkAttributes = frameworkAttributes; } /** *

* Attributes of the blockchain framework that the network uses. *

* * @return Attributes of the blockchain framework that the network uses. */ public NetworkFrameworkAttributes getFrameworkAttributes() { return this.frameworkAttributes; } /** *

* Attributes of the blockchain framework that the network uses. *

* * @param frameworkAttributes * Attributes of the blockchain framework that the network uses. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withFrameworkAttributes(NetworkFrameworkAttributes frameworkAttributes) { setFrameworkAttributes(frameworkAttributes); return this; } /** *

* The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint service * name to create a VPC endpoint to access network resources. *

* * @param vpcEndpointServiceName * The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint * service name to create a VPC endpoint to access network resources. */ public void setVpcEndpointServiceName(String vpcEndpointServiceName) { this.vpcEndpointServiceName = vpcEndpointServiceName; } /** *

* The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint service * name to create a VPC endpoint to access network resources. *

* * @return The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint * service name to create a VPC endpoint to access network resources. */ public String getVpcEndpointServiceName() { return this.vpcEndpointServiceName; } /** *

* The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint service * name to create a VPC endpoint to access network resources. *

* * @param vpcEndpointServiceName * The VPC endpoint service name of the VPC endpoint service of the network. Members use the VPC endpoint * service name to create a VPC endpoint to access network resources. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withVpcEndpointServiceName(String vpcEndpointServiceName) { setVpcEndpointServiceName(vpcEndpointServiceName); return this; } /** *

* The voting rules that the network uses to decide if a proposal is accepted. *

* * @param votingPolicy * The voting rules that the network uses to decide if a proposal is accepted. */ public void setVotingPolicy(VotingPolicy votingPolicy) { this.votingPolicy = votingPolicy; } /** *

* The voting rules that the network uses to decide if a proposal is accepted. *

* * @return The voting rules that the network uses to decide if a proposal is accepted. */ public VotingPolicy getVotingPolicy() { return this.votingPolicy; } /** *

* The voting rules that the network uses to decide if a proposal is accepted. *

* * @param votingPolicy * The voting rules that the network uses to decide if a proposal is accepted. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withVotingPolicy(VotingPolicy votingPolicy) { setVotingPolicy(votingPolicy); return this; } /** *

* The current status of the network. *

* * @param status * The current status of the network. * @see NetworkStatus */ public void setStatus(String status) { this.status = status; } /** *

* The current status of the network. *

* * @return The current status of the network. * @see NetworkStatus */ public String getStatus() { return this.status; } /** *

* The current status of the network. *

* * @param status * The current status of the network. * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkStatus */ public Network withStatus(String status) { setStatus(status); return this; } /** *

* The current status of the network. *

* * @param status * The current status of the network. * @return Returns a reference to this object so that method calls can be chained together. * @see NetworkStatus */ public Network withStatus(NetworkStatus status) { this.status = status.toString(); return this; } /** *

* The date and time that the network was created. *

* * @param creationDate * The date and time that the network was created. */ public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } /** *

* The date and time that the network was created. *

* * @return The date and time that the network was created. */ public java.util.Date getCreationDate() { return this.creationDate; } /** *

* The date and time that the network was created. *

* * @param creationDate * The date and time that the network was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withCreationDate(java.util.Date creationDate) { setCreationDate(creationDate); return this; } /** *

* Tags assigned to the network. Each tag consists of a key and optional value. *

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

* * @return Tags assigned to the network. Each tag consists of a key and optional value.

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. */ public java.util.Map getTags() { return tags; } /** *

* Tags assigned to the network. Each tag consists of a key and optional value. *

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

* * @param tags * Tags assigned to the network. Each tag consists of a key and optional value.

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* Tags assigned to the network. Each tag consists of a key and optional value. *

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. *

* * @param tags * Tags assigned to the network. Each tag consists of a key and optional value.

*

* For more information about tags, see Tagging * Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see Network#withTags * @returns a reference to this object so that method calls can be chained together. */ public Network addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public Network clearTagsEntries() { this.tags = null; return this; } /** *

* The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @param arn * The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @return The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @param arn * The Amazon Resource Name (ARN) of the network. For more information about ARNs and their format, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. * @return Returns a reference to this object so that method calls can be chained together. */ public Network withArn(String arn) { setArn(arn); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getFramework() != null) sb.append("Framework: ").append(getFramework()).append(","); if (getFrameworkVersion() != null) sb.append("FrameworkVersion: ").append(getFrameworkVersion()).append(","); if (getFrameworkAttributes() != null) sb.append("FrameworkAttributes: ").append(getFrameworkAttributes()).append(","); if (getVpcEndpointServiceName() != null) sb.append("VpcEndpointServiceName: ").append(getVpcEndpointServiceName()).append(","); if (getVotingPolicy() != null) sb.append("VotingPolicy: ").append(getVotingPolicy()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getCreationDate() != null) sb.append("CreationDate: ").append(getCreationDate()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Network == false) return false; Network other = (Network) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getFramework() == null ^ this.getFramework() == null) return false; if (other.getFramework() != null && other.getFramework().equals(this.getFramework()) == false) return false; if (other.getFrameworkVersion() == null ^ this.getFrameworkVersion() == null) return false; if (other.getFrameworkVersion() != null && other.getFrameworkVersion().equals(this.getFrameworkVersion()) == false) return false; if (other.getFrameworkAttributes() == null ^ this.getFrameworkAttributes() == null) return false; if (other.getFrameworkAttributes() != null && other.getFrameworkAttributes().equals(this.getFrameworkAttributes()) == false) return false; if (other.getVpcEndpointServiceName() == null ^ this.getVpcEndpointServiceName() == null) return false; if (other.getVpcEndpointServiceName() != null && other.getVpcEndpointServiceName().equals(this.getVpcEndpointServiceName()) == false) return false; if (other.getVotingPolicy() == null ^ this.getVotingPolicy() == null) return false; if (other.getVotingPolicy() != null && other.getVotingPolicy().equals(this.getVotingPolicy()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getCreationDate() == null ^ this.getCreationDate() == null) return false; if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getFramework() == null) ? 0 : getFramework().hashCode()); hashCode = prime * hashCode + ((getFrameworkVersion() == null) ? 0 : getFrameworkVersion().hashCode()); hashCode = prime * hashCode + ((getFrameworkAttributes() == null) ? 0 : getFrameworkAttributes().hashCode()); hashCode = prime * hashCode + ((getVpcEndpointServiceName() == null) ? 0 : getVpcEndpointServiceName().hashCode()); hashCode = prime * hashCode + ((getVotingPolicy() == null) ? 0 : getVotingPolicy().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); return hashCode; } @Override public Network clone() { try { return (Network) 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.managedblockchain.model.transform.NetworkMarshaller.getInstance().marshall(this, protocolMarshaller); } }