com.amazonaws.services.networkmanager.model.ConnectPeer Maven / Gradle / Ivy
Show all versions of aws-java-sdk-networkmanager Show documentation
/*
* Copyright 2019-2024 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.networkmanager.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes a core network Connect peer.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConnectPeer implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of a core network.
*
*/
private String coreNetworkId;
/**
*
* The ID of the attachment to connect.
*
*/
private String connectAttachmentId;
/**
*
* The ID of the Connect peer.
*
*/
private String connectPeerId;
/**
*
* The Connect peer Regions where edges are located.
*
*/
private String edgeLocation;
/**
*
* The state of the Connect peer.
*
*/
private String state;
/**
*
* The timestamp when the Connect peer was created.
*
*/
private java.util.Date createdAt;
/**
*
* The configuration of the Connect peer.
*
*/
private ConnectPeerConfiguration configuration;
/**
*
* The list of key-value tags associated with the Connect peer.
*
*/
private java.util.List tags;
/**
*
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*
*/
private String subnetArn;
/**
*
* Describes the error associated with the attachment request.
*
*/
private java.util.List lastModificationErrors;
/**
*
* The ID of a core network.
*
*
* @param coreNetworkId
* The ID of a core network.
*/
public void setCoreNetworkId(String coreNetworkId) {
this.coreNetworkId = coreNetworkId;
}
/**
*
* The ID of a core network.
*
*
* @return The ID of a core network.
*/
public String getCoreNetworkId() {
return this.coreNetworkId;
}
/**
*
* The ID of a core network.
*
*
* @param coreNetworkId
* The ID of a core network.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withCoreNetworkId(String coreNetworkId) {
setCoreNetworkId(coreNetworkId);
return this;
}
/**
*
* The ID of the attachment to connect.
*
*
* @param connectAttachmentId
* The ID of the attachment to connect.
*/
public void setConnectAttachmentId(String connectAttachmentId) {
this.connectAttachmentId = connectAttachmentId;
}
/**
*
* The ID of the attachment to connect.
*
*
* @return The ID of the attachment to connect.
*/
public String getConnectAttachmentId() {
return this.connectAttachmentId;
}
/**
*
* The ID of the attachment to connect.
*
*
* @param connectAttachmentId
* The ID of the attachment to connect.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withConnectAttachmentId(String connectAttachmentId) {
setConnectAttachmentId(connectAttachmentId);
return this;
}
/**
*
* The ID of the Connect peer.
*
*
* @param connectPeerId
* The ID of the Connect peer.
*/
public void setConnectPeerId(String connectPeerId) {
this.connectPeerId = connectPeerId;
}
/**
*
* The ID of the Connect peer.
*
*
* @return The ID of the Connect peer.
*/
public String getConnectPeerId() {
return this.connectPeerId;
}
/**
*
* The ID of the Connect peer.
*
*
* @param connectPeerId
* The ID of the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withConnectPeerId(String connectPeerId) {
setConnectPeerId(connectPeerId);
return this;
}
/**
*
* The Connect peer Regions where edges are located.
*
*
* @param edgeLocation
* The Connect peer Regions where edges are located.
*/
public void setEdgeLocation(String edgeLocation) {
this.edgeLocation = edgeLocation;
}
/**
*
* The Connect peer Regions where edges are located.
*
*
* @return The Connect peer Regions where edges are located.
*/
public String getEdgeLocation() {
return this.edgeLocation;
}
/**
*
* The Connect peer Regions where edges are located.
*
*
* @param edgeLocation
* The Connect peer Regions where edges are located.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withEdgeLocation(String edgeLocation) {
setEdgeLocation(edgeLocation);
return this;
}
/**
*
* The state of the Connect peer.
*
*
* @param state
* The state of the Connect peer.
* @see ConnectPeerState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the Connect peer.
*
*
* @return The state of the Connect peer.
* @see ConnectPeerState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the Connect peer.
*
*
* @param state
* The state of the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectPeerState
*/
public ConnectPeer withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the Connect peer.
*
*
* @param state
* The state of the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConnectPeerState
*/
public ConnectPeer withState(ConnectPeerState state) {
this.state = state.toString();
return this;
}
/**
*
* The timestamp when the Connect peer was created.
*
*
* @param createdAt
* The timestamp when the Connect peer was created.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* The timestamp when the Connect peer was created.
*
*
* @return The timestamp when the Connect peer was created.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* The timestamp when the Connect peer was created.
*
*
* @param createdAt
* The timestamp when the Connect peer was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* The configuration of the Connect peer.
*
*
* @param configuration
* The configuration of the Connect peer.
*/
public void setConfiguration(ConnectPeerConfiguration configuration) {
this.configuration = configuration;
}
/**
*
* The configuration of the Connect peer.
*
*
* @return The configuration of the Connect peer.
*/
public ConnectPeerConfiguration getConfiguration() {
return this.configuration;
}
/**
*
* The configuration of the Connect peer.
*
*
* @param configuration
* The configuration of the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withConfiguration(ConnectPeerConfiguration configuration) {
setConfiguration(configuration);
return this;
}
/**
*
* The list of key-value tags associated with the Connect peer.
*
*
* @return The list of key-value tags associated with the Connect peer.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The list of key-value tags associated with the Connect peer.
*
*
* @param tags
* The list of key-value tags associated with the Connect peer.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The list of key-value tags associated with the Connect peer.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The list of key-value tags associated with the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The list of key-value tags associated with the Connect peer.
*
*
* @param tags
* The list of key-value tags associated with the Connect peer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*
*
* @param subnetArn
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*/
public void setSubnetArn(String subnetArn) {
this.subnetArn = subnetArn;
}
/**
*
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*
*
* @return The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*/
public String getSubnetArn() {
return this.subnetArn;
}
/**
*
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
*
*
* @param subnetArn
* The subnet ARN for the Connect peer. This only applies only when the protocol is NO_ENCAP.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withSubnetArn(String subnetArn) {
setSubnetArn(subnetArn);
return this;
}
/**
*
* Describes the error associated with the attachment request.
*
*
* @return Describes the error associated with the attachment request.
*/
public java.util.List getLastModificationErrors() {
return lastModificationErrors;
}
/**
*
* Describes the error associated with the attachment request.
*
*
* @param lastModificationErrors
* Describes the error associated with the attachment request.
*/
public void setLastModificationErrors(java.util.Collection lastModificationErrors) {
if (lastModificationErrors == null) {
this.lastModificationErrors = null;
return;
}
this.lastModificationErrors = new java.util.ArrayList(lastModificationErrors);
}
/**
*
* Describes the error associated with the attachment request.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLastModificationErrors(java.util.Collection)} or
* {@link #withLastModificationErrors(java.util.Collection)} if you want to override the existing values.
*
*
* @param lastModificationErrors
* Describes the error associated with the attachment request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withLastModificationErrors(ConnectPeerError... lastModificationErrors) {
if (this.lastModificationErrors == null) {
setLastModificationErrors(new java.util.ArrayList(lastModificationErrors.length));
}
for (ConnectPeerError ele : lastModificationErrors) {
this.lastModificationErrors.add(ele);
}
return this;
}
/**
*
* Describes the error associated with the attachment request.
*
*
* @param lastModificationErrors
* Describes the error associated with the attachment request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConnectPeer withLastModificationErrors(java.util.Collection lastModificationErrors) {
setLastModificationErrors(lastModificationErrors);
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 (getCoreNetworkId() != null)
sb.append("CoreNetworkId: ").append(getCoreNetworkId()).append(",");
if (getConnectAttachmentId() != null)
sb.append("ConnectAttachmentId: ").append(getConnectAttachmentId()).append(",");
if (getConnectPeerId() != null)
sb.append("ConnectPeerId: ").append(getConnectPeerId()).append(",");
if (getEdgeLocation() != null)
sb.append("EdgeLocation: ").append(getEdgeLocation()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getCreatedAt() != null)
sb.append("CreatedAt: ").append(getCreatedAt()).append(",");
if (getConfiguration() != null)
sb.append("Configuration: ").append(getConfiguration()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getSubnetArn() != null)
sb.append("SubnetArn: ").append(getSubnetArn()).append(",");
if (getLastModificationErrors() != null)
sb.append("LastModificationErrors: ").append(getLastModificationErrors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConnectPeer == false)
return false;
ConnectPeer other = (ConnectPeer) obj;
if (other.getCoreNetworkId() == null ^ this.getCoreNetworkId() == null)
return false;
if (other.getCoreNetworkId() != null && other.getCoreNetworkId().equals(this.getCoreNetworkId()) == false)
return false;
if (other.getConnectAttachmentId() == null ^ this.getConnectAttachmentId() == null)
return false;
if (other.getConnectAttachmentId() != null && other.getConnectAttachmentId().equals(this.getConnectAttachmentId()) == false)
return false;
if (other.getConnectPeerId() == null ^ this.getConnectPeerId() == null)
return false;
if (other.getConnectPeerId() != null && other.getConnectPeerId().equals(this.getConnectPeerId()) == false)
return false;
if (other.getEdgeLocation() == null ^ this.getEdgeLocation() == null)
return false;
if (other.getEdgeLocation() != null && other.getEdgeLocation().equals(this.getEdgeLocation()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getConfiguration() == null ^ this.getConfiguration() == null)
return false;
if (other.getConfiguration() != null && other.getConfiguration().equals(this.getConfiguration()) == 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.getSubnetArn() == null ^ this.getSubnetArn() == null)
return false;
if (other.getSubnetArn() != null && other.getSubnetArn().equals(this.getSubnetArn()) == false)
return false;
if (other.getLastModificationErrors() == null ^ this.getLastModificationErrors() == null)
return false;
if (other.getLastModificationErrors() != null && other.getLastModificationErrors().equals(this.getLastModificationErrors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCoreNetworkId() == null) ? 0 : getCoreNetworkId().hashCode());
hashCode = prime * hashCode + ((getConnectAttachmentId() == null) ? 0 : getConnectAttachmentId().hashCode());
hashCode = prime * hashCode + ((getConnectPeerId() == null) ? 0 : getConnectPeerId().hashCode());
hashCode = prime * hashCode + ((getEdgeLocation() == null) ? 0 : getEdgeLocation().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getSubnetArn() == null) ? 0 : getSubnetArn().hashCode());
hashCode = prime * hashCode + ((getLastModificationErrors() == null) ? 0 : getLastModificationErrors().hashCode());
return hashCode;
}
@Override
public ConnectPeer clone() {
try {
return (ConnectPeer) 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.networkmanager.model.transform.ConnectPeerMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}