com.amazonaws.services.iotsecuretunneling.model.DestinationConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-iotsecuretunneling 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.iotsecuretunneling.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The destination configuration.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DestinationConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the IoT thing to which you want to connect.
*
*/
private String thingName;
/**
*
* A list of service names that identify the target application. The IoT client running on the destination device
* reads this value and uses it to look up a port or an IP address and a port. The IoT client instantiates the local
* proxy, which uses this information to connect to the destination application.
*
*/
private java.util.List services;
/**
*
* The name of the IoT thing to which you want to connect.
*
*
* @param thingName
* The name of the IoT thing to which you want to connect.
*/
public void setThingName(String thingName) {
this.thingName = thingName;
}
/**
*
* The name of the IoT thing to which you want to connect.
*
*
* @return The name of the IoT thing to which you want to connect.
*/
public String getThingName() {
return this.thingName;
}
/**
*
* The name of the IoT thing to which you want to connect.
*
*
* @param thingName
* The name of the IoT thing to which you want to connect.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DestinationConfig withThingName(String thingName) {
setThingName(thingName);
return this;
}
/**
*
* A list of service names that identify the target application. The IoT client running on the destination device
* reads this value and uses it to look up a port or an IP address and a port. The IoT client instantiates the local
* proxy, which uses this information to connect to the destination application.
*
*
* @return A list of service names that identify the target application. The IoT client running on the destination
* device reads this value and uses it to look up a port or an IP address and a port. The IoT client
* instantiates the local proxy, which uses this information to connect to the destination application.
*/
public java.util.List getServices() {
return services;
}
/**
*
* A list of service names that identify the target application. The IoT client running on the destination device
* reads this value and uses it to look up a port or an IP address and a port. The IoT client instantiates the local
* proxy, which uses this information to connect to the destination application.
*
*
* @param services
* A list of service names that identify the target application. The IoT client running on the destination
* device reads this value and uses it to look up a port or an IP address and a port. The IoT client
* instantiates the local proxy, which uses this information to connect to the destination application.
*/
public void setServices(java.util.Collection services) {
if (services == null) {
this.services = null;
return;
}
this.services = new java.util.ArrayList(services);
}
/**
*
* A list of service names that identify the target application. The IoT client running on the destination device
* reads this value and uses it to look up a port or an IP address and a port. The IoT client instantiates the local
* proxy, which uses this information to connect to the destination application.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setServices(java.util.Collection)} or {@link #withServices(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param services
* A list of service names that identify the target application. The IoT client running on the destination
* device reads this value and uses it to look up a port or an IP address and a port. The IoT client
* instantiates the local proxy, which uses this information to connect to the destination application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DestinationConfig withServices(String... services) {
if (this.services == null) {
setServices(new java.util.ArrayList(services.length));
}
for (String ele : services) {
this.services.add(ele);
}
return this;
}
/**
*
* A list of service names that identify the target application. The IoT client running on the destination device
* reads this value and uses it to look up a port or an IP address and a port. The IoT client instantiates the local
* proxy, which uses this information to connect to the destination application.
*
*
* @param services
* A list of service names that identify the target application. The IoT client running on the destination
* device reads this value and uses it to look up a port or an IP address and a port. The IoT client
* instantiates the local proxy, which uses this information to connect to the destination application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DestinationConfig withServices(java.util.Collection services) {
setServices(services);
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 (getThingName() != null)
sb.append("ThingName: ").append(getThingName()).append(",");
if (getServices() != null)
sb.append("Services: ").append(getServices());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DestinationConfig == false)
return false;
DestinationConfig other = (DestinationConfig) obj;
if (other.getThingName() == null ^ this.getThingName() == null)
return false;
if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false)
return false;
if (other.getServices() == null ^ this.getServices() == null)
return false;
if (other.getServices() != null && other.getServices().equals(this.getServices()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode());
hashCode = prime * hashCode + ((getServices() == null) ? 0 : getServices().hashCode());
return hashCode;
}
@Override
public DestinationConfig clone() {
try {
return (DestinationConfig) 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.iotsecuretunneling.model.transform.DestinationConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}