All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.fms.model.Route Maven / Gradle / Ivy

Go to download

The AWS Java SDK for FMS module holds the client classes that are used for communicating with FMS.

There is a newer version: 2.29.15
Show 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.fms.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.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;

/**
 * 

* Describes a route in a route table. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Route implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DESTINATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DestinationType").getter(getter(Route::destinationTypeAsString)) .setter(setter(Builder::destinationType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationType").build()).build(); private static final SdkField TARGET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TargetType").getter(getter(Route::targetTypeAsString)).setter(setter(Builder::targetType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetType").build()).build(); private static final SdkField DESTINATION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Destination").getter(getter(Route::destination)).setter(setter(Builder::destination)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Destination").build()).build(); private static final SdkField TARGET_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Target") .getter(getter(Route::target)).setter(setter(Builder::target)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Target").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DESTINATION_TYPE_FIELD, TARGET_TYPE_FIELD, DESTINATION_FIELD, TARGET_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("DestinationType", DESTINATION_TYPE_FIELD); put("TargetType", TARGET_TYPE_FIELD); put("Destination", DESTINATION_FIELD); put("Target", TARGET_FIELD); } }); private static final long serialVersionUID = 1L; private final String destinationType; private final String targetType; private final String destination; private final String target; private Route(BuilderImpl builder) { this.destinationType = builder.destinationType; this.targetType = builder.targetType; this.destination = builder.destination; this.target = builder.target; } /** *

* The type of destination for the route. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #destinationType} * will return {@link DestinationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #destinationTypeAsString}. *

* * @return The type of destination for the route. * @see DestinationType */ public final DestinationType destinationType() { return DestinationType.fromValue(destinationType); } /** *

* The type of destination for the route. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #destinationType} * will return {@link DestinationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #destinationTypeAsString}. *

* * @return The type of destination for the route. * @see DestinationType */ public final String destinationTypeAsString() { return destinationType; } /** *

* The type of target for the route. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #targetType} will * return {@link TargetType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #targetTypeAsString}. *

* * @return The type of target for the route. * @see TargetType */ public final TargetType targetType() { return TargetType.fromValue(targetType); } /** *

* The type of target for the route. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #targetType} will * return {@link TargetType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #targetTypeAsString}. *

* * @return The type of target for the route. * @see TargetType */ public final String targetTypeAsString() { return targetType; } /** *

* The destination of the route. *

* * @return The destination of the route. */ public final String destination() { return destination; } /** *

* The route's target. *

* * @return The route's target. */ public final String target() { return target; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(destinationTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(targetTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(destination()); hashCode = 31 * hashCode + Objects.hashCode(target()); 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 Route)) { return false; } Route other = (Route) obj; return Objects.equals(destinationTypeAsString(), other.destinationTypeAsString()) && Objects.equals(targetTypeAsString(), other.targetTypeAsString()) && Objects.equals(destination(), other.destination()) && Objects.equals(target(), other.target()); } /** * 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("Route").add("DestinationType", destinationTypeAsString()) .add("TargetType", targetTypeAsString()).add("Destination", destination()).add("Target", target()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DestinationType": return Optional.ofNullable(clazz.cast(destinationTypeAsString())); case "TargetType": return Optional.ofNullable(clazz.cast(targetTypeAsString())); case "Destination": return Optional.ofNullable(clazz.cast(destination())); case "Target": return Optional.ofNullable(clazz.cast(target())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((Route) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The type of destination for the route. *

* * @param destinationType * The type of destination for the route. * @see DestinationType * @return Returns a reference to this object so that method calls can be chained together. * @see DestinationType */ Builder destinationType(String destinationType); /** *

* The type of destination for the route. *

* * @param destinationType * The type of destination for the route. * @see DestinationType * @return Returns a reference to this object so that method calls can be chained together. * @see DestinationType */ Builder destinationType(DestinationType destinationType); /** *

* The type of target for the route. *

* * @param targetType * The type of target for the route. * @see TargetType * @return Returns a reference to this object so that method calls can be chained together. * @see TargetType */ Builder targetType(String targetType); /** *

* The type of target for the route. *

* * @param targetType * The type of target for the route. * @see TargetType * @return Returns a reference to this object so that method calls can be chained together. * @see TargetType */ Builder targetType(TargetType targetType); /** *

* The destination of the route. *

* * @param destination * The destination of the route. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destination(String destination); /** *

* The route's target. *

* * @param target * The route's target. * @return Returns a reference to this object so that method calls can be chained together. */ Builder target(String target); } static final class BuilderImpl implements Builder { private String destinationType; private String targetType; private String destination; private String target; private BuilderImpl() { } private BuilderImpl(Route model) { destinationType(model.destinationType); targetType(model.targetType); destination(model.destination); target(model.target); } public final String getDestinationType() { return destinationType; } public final void setDestinationType(String destinationType) { this.destinationType = destinationType; } @Override public final Builder destinationType(String destinationType) { this.destinationType = destinationType; return this; } @Override public final Builder destinationType(DestinationType destinationType) { this.destinationType(destinationType == null ? null : destinationType.toString()); return this; } public final String getTargetType() { return targetType; } public final void setTargetType(String targetType) { this.targetType = targetType; } @Override public final Builder targetType(String targetType) { this.targetType = targetType; return this; } @Override public final Builder targetType(TargetType targetType) { this.targetType(targetType == null ? null : targetType.toString()); return this; } public final String getDestination() { return destination; } public final void setDestination(String destination) { this.destination = destination; } @Override public final Builder destination(String destination) { this.destination = destination; return this; } public final String getTarget() { return target; } public final void setTarget(String target) { this.target = target; } @Override public final Builder target(String target) { this.target = target; return this; } @Override public Route build() { return new Route(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy