com.amazonaws.services.eventbridge.model.CreateEndpointResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-eventbridge 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.eventbridge.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateEndpointResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The name of the endpoint that was created by this request.
*
*/
private String name;
/**
*
* The ARN of the endpoint that was created by this request.
*
*/
private String arn;
/**
*
* The routing configuration defined by this request.
*
*/
private RoutingConfig routingConfig;
/**
*
* Whether event replication was enabled or disabled by this request.
*
*/
private ReplicationConfig replicationConfig;
/**
*
* The event buses used by this request.
*
*/
private java.util.List eventBuses;
/**
*
* The ARN of the role used by event replication for this request.
*
*/
private String roleArn;
/**
*
* The state of the endpoint that was created by this request.
*
*/
private String state;
/**
*
* The name of the endpoint that was created by this request.
*
*
* @param name
* The name of the endpoint that was created by this request.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the endpoint that was created by this request.
*
*
* @return The name of the endpoint that was created by this request.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the endpoint that was created by this request.
*
*
* @param name
* The name of the endpoint that was created by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withName(String name) {
setName(name);
return this;
}
/**
*
* The ARN of the endpoint that was created by this request.
*
*
* @param arn
* The ARN of the endpoint that was created by this request.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The ARN of the endpoint that was created by this request.
*
*
* @return The ARN of the endpoint that was created by this request.
*/
public String getArn() {
return this.arn;
}
/**
*
* The ARN of the endpoint that was created by this request.
*
*
* @param arn
* The ARN of the endpoint that was created by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The routing configuration defined by this request.
*
*
* @param routingConfig
* The routing configuration defined by this request.
*/
public void setRoutingConfig(RoutingConfig routingConfig) {
this.routingConfig = routingConfig;
}
/**
*
* The routing configuration defined by this request.
*
*
* @return The routing configuration defined by this request.
*/
public RoutingConfig getRoutingConfig() {
return this.routingConfig;
}
/**
*
* The routing configuration defined by this request.
*
*
* @param routingConfig
* The routing configuration defined by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withRoutingConfig(RoutingConfig routingConfig) {
setRoutingConfig(routingConfig);
return this;
}
/**
*
* Whether event replication was enabled or disabled by this request.
*
*
* @param replicationConfig
* Whether event replication was enabled or disabled by this request.
*/
public void setReplicationConfig(ReplicationConfig replicationConfig) {
this.replicationConfig = replicationConfig;
}
/**
*
* Whether event replication was enabled or disabled by this request.
*
*
* @return Whether event replication was enabled or disabled by this request.
*/
public ReplicationConfig getReplicationConfig() {
return this.replicationConfig;
}
/**
*
* Whether event replication was enabled or disabled by this request.
*
*
* @param replicationConfig
* Whether event replication was enabled or disabled by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withReplicationConfig(ReplicationConfig replicationConfig) {
setReplicationConfig(replicationConfig);
return this;
}
/**
*
* The event buses used by this request.
*
*
* @return The event buses used by this request.
*/
public java.util.List getEventBuses() {
return eventBuses;
}
/**
*
* The event buses used by this request.
*
*
* @param eventBuses
* The event buses used by this request.
*/
public void setEventBuses(java.util.Collection eventBuses) {
if (eventBuses == null) {
this.eventBuses = null;
return;
}
this.eventBuses = new java.util.ArrayList(eventBuses);
}
/**
*
* The event buses used by this request.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEventBuses(java.util.Collection)} or {@link #withEventBuses(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param eventBuses
* The event buses used by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withEventBuses(EndpointEventBus... eventBuses) {
if (this.eventBuses == null) {
setEventBuses(new java.util.ArrayList(eventBuses.length));
}
for (EndpointEventBus ele : eventBuses) {
this.eventBuses.add(ele);
}
return this;
}
/**
*
* The event buses used by this request.
*
*
* @param eventBuses
* The event buses used by this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withEventBuses(java.util.Collection eventBuses) {
setEventBuses(eventBuses);
return this;
}
/**
*
* The ARN of the role used by event replication for this request.
*
*
* @param roleArn
* The ARN of the role used by event replication for this request.
*/
public void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
/**
*
* The ARN of the role used by event replication for this request.
*
*
* @return The ARN of the role used by event replication for this request.
*/
public String getRoleArn() {
return this.roleArn;
}
/**
*
* The ARN of the role used by event replication for this request.
*
*
* @param roleArn
* The ARN of the role used by event replication for this request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateEndpointResult withRoleArn(String roleArn) {
setRoleArn(roleArn);
return this;
}
/**
*
* The state of the endpoint that was created by this request.
*
*
* @param state
* The state of the endpoint that was created by this request.
* @see EndpointState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the endpoint that was created by this request.
*
*
* @return The state of the endpoint that was created by this request.
* @see EndpointState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the endpoint that was created by this request.
*
*
* @param state
* The state of the endpoint that was created by this request.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndpointState
*/
public CreateEndpointResult withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the endpoint that was created by this request.
*
*
* @param state
* The state of the endpoint that was created by this request.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndpointState
*/
public CreateEndpointResult withState(EndpointState state) {
this.state = state.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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getRoutingConfig() != null)
sb.append("RoutingConfig: ").append(getRoutingConfig()).append(",");
if (getReplicationConfig() != null)
sb.append("ReplicationConfig: ").append(getReplicationConfig()).append(",");
if (getEventBuses() != null)
sb.append("EventBuses: ").append(getEventBuses()).append(",");
if (getRoleArn() != null)
sb.append("RoleArn: ").append(getRoleArn()).append(",");
if (getState() != null)
sb.append("State: ").append(getState());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateEndpointResult == false)
return false;
CreateEndpointResult other = (CreateEndpointResult) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getRoutingConfig() == null ^ this.getRoutingConfig() == null)
return false;
if (other.getRoutingConfig() != null && other.getRoutingConfig().equals(this.getRoutingConfig()) == false)
return false;
if (other.getReplicationConfig() == null ^ this.getReplicationConfig() == null)
return false;
if (other.getReplicationConfig() != null && other.getReplicationConfig().equals(this.getReplicationConfig()) == false)
return false;
if (other.getEventBuses() == null ^ this.getEventBuses() == null)
return false;
if (other.getEventBuses() != null && other.getEventBuses().equals(this.getEventBuses()) == false)
return false;
if (other.getRoleArn() == null ^ this.getRoleArn() == null)
return false;
if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getRoutingConfig() == null) ? 0 : getRoutingConfig().hashCode());
hashCode = prime * hashCode + ((getReplicationConfig() == null) ? 0 : getReplicationConfig().hashCode());
hashCode = prime * hashCode + ((getEventBuses() == null) ? 0 : getEventBuses().hashCode());
hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
return hashCode;
}
@Override
public CreateEndpointResult clone() {
try {
return (CreateEndpointResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}