software.amazon.awssdk.services.servicediscovery.model.ServiceChange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of servicediscovery Show documentation
Show all versions of servicediscovery Show documentation
The AWS Java SDK for Amazon Route 53 Auto Naming module holds the client classes that are used for communicating
with Amazon Route 53 Auto Naming Service
The newest version!
/*
* Copyright 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 software.amazon.awssdk.services.servicediscovery.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A complex type that contains changes to an existing service.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ServiceChange implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(ServiceChange::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField DNS_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DnsConfig").getter(getter(ServiceChange::dnsConfig))
.setter(setter(Builder::dnsConfig)).constructor(DnsConfigChange::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DnsConfig").build()).build();
private static final SdkField HEALTH_CHECK_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("HealthCheckConfig")
.getter(getter(ServiceChange::healthCheckConfig)).setter(setter(Builder::healthCheckConfig))
.constructor(HealthCheckConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HealthCheckConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DESCRIPTION_FIELD,
DNS_CONFIG_FIELD, HEALTH_CHECK_CONFIG_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String description;
private final DnsConfigChange dnsConfig;
private final HealthCheckConfig healthCheckConfig;
private ServiceChange(BuilderImpl builder) {
this.description = builder.description;
this.dnsConfig = builder.dnsConfig;
this.healthCheckConfig = builder.healthCheckConfig;
}
/**
*
* A description for the service.
*
*
* @return A description for the service.
*/
public final String description() {
return description;
}
/**
*
* Information about the Route 53 DNS records that you want Cloud Map to create when you register an instance.
*
*
* @return Information about the Route 53 DNS records that you want Cloud Map to create when you register an
* instance.
*/
public final DnsConfigChange dnsConfig() {
return dnsConfig;
}
/**
*
* Public DNS and HTTP namespaces only. Settings for an optional health check. If you specify settings for a
* health check, Cloud Map associates the health check with the records that you specify in DnsConfig
.
*
*
* @return Public DNS and HTTP namespaces only. Settings for an optional health check. If you specify
* settings for a health check, Cloud Map associates the health check with the records that you specify in
* DnsConfig
.
*/
public final HealthCheckConfig healthCheckConfig() {
return healthCheckConfig;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(dnsConfig());
hashCode = 31 * hashCode + Objects.hashCode(healthCheckConfig());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ServiceChange)) {
return false;
}
ServiceChange other = (ServiceChange) obj;
return Objects.equals(description(), other.description()) && Objects.equals(dnsConfig(), other.dnsConfig())
&& Objects.equals(healthCheckConfig(), other.healthCheckConfig());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("ServiceChange").add("Description", description()).add("DnsConfig", dnsConfig())
.add("HealthCheckConfig", healthCheckConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DnsConfig":
return Optional.ofNullable(clazz.cast(dnsConfig()));
case "HealthCheckConfig":
return Optional.ofNullable(clazz.cast(healthCheckConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("Description", DESCRIPTION_FIELD);
map.put("DnsConfig", DNS_CONFIG_FIELD);
map.put("HealthCheckConfig", HEALTH_CHECK_CONFIG_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy