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

software.amazon.awssdk.services.ec2.model.NetworkInfo Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 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.ec2.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the networking features of the instance type. *

*/ @Generated("software.amazon.awssdk:codegen") public final class NetworkInfo implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NETWORK_PERFORMANCE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("NetworkPerformance") .getter(getter(NetworkInfo::networkPerformance)) .setter(setter(Builder::networkPerformance)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkPerformance") .unmarshallLocationName("networkPerformance").build()).build(); private static final SdkField MAXIMUM_NETWORK_INTERFACES_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("MaximumNetworkInterfaces") .getter(getter(NetworkInfo::maximumNetworkInterfaces)) .setter(setter(Builder::maximumNetworkInterfaces)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaximumNetworkInterfaces") .unmarshallLocationName("maximumNetworkInterfaces").build()).build(); private static final SdkField MAXIMUM_NETWORK_CARDS_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("MaximumNetworkCards") .getter(getter(NetworkInfo::maximumNetworkCards)) .setter(setter(Builder::maximumNetworkCards)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaximumNetworkCards") .unmarshallLocationName("maximumNetworkCards").build()).build(); private static final SdkField DEFAULT_NETWORK_CARD_INDEX_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("DefaultNetworkCardIndex") .getter(getter(NetworkInfo::defaultNetworkCardIndex)) .setter(setter(Builder::defaultNetworkCardIndex)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultNetworkCardIndex") .unmarshallLocationName("defaultNetworkCardIndex").build()).build(); private static final SdkField> NETWORK_CARDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NetworkCards") .getter(getter(NetworkInfo::networkCards)) .setter(setter(Builder::networkCards)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkCards") .unmarshallLocationName("networkCards").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(NetworkCardInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final SdkField IPV4_ADDRESSES_PER_INTERFACE_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Ipv4AddressesPerInterface") .getter(getter(NetworkInfo::ipv4AddressesPerInterface)) .setter(setter(Builder::ipv4AddressesPerInterface)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv4AddressesPerInterface") .unmarshallLocationName("ipv4AddressesPerInterface").build()).build(); private static final SdkField IPV6_ADDRESSES_PER_INTERFACE_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Ipv6AddressesPerInterface") .getter(getter(NetworkInfo::ipv6AddressesPerInterface)) .setter(setter(Builder::ipv6AddressesPerInterface)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6AddressesPerInterface") .unmarshallLocationName("ipv6AddressesPerInterface").build()).build(); private static final SdkField IPV6_SUPPORTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("Ipv6Supported") .getter(getter(NetworkInfo::ipv6Supported)) .setter(setter(Builder::ipv6Supported)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ipv6Supported") .unmarshallLocationName("ipv6Supported").build()).build(); private static final SdkField ENA_SUPPORT_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("EnaSupport") .getter(getter(NetworkInfo::enaSupportAsString)) .setter(setter(Builder::enaSupport)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnaSupport") .unmarshallLocationName("enaSupport").build()).build(); private static final SdkField EFA_SUPPORTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("EfaSupported") .getter(getter(NetworkInfo::efaSupported)) .setter(setter(Builder::efaSupported)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EfaSupported") .unmarshallLocationName("efaSupported").build()).build(); private static final SdkField EFA_INFO_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("EfaInfo") .getter(getter(NetworkInfo::efaInfo)) .setter(setter(Builder::efaInfo)) .constructor(EfaInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EfaInfo") .unmarshallLocationName("efaInfo").build()).build(); private static final SdkField ENCRYPTION_IN_TRANSIT_SUPPORTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("EncryptionInTransitSupported") .getter(getter(NetworkInfo::encryptionInTransitSupported)) .setter(setter(Builder::encryptionInTransitSupported)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncryptionInTransitSupported") .unmarshallLocationName("encryptionInTransitSupported").build()).build(); private static final SdkField ENA_SRD_SUPPORTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("EnaSrdSupported") .getter(getter(NetworkInfo::enaSrdSupported)) .setter(setter(Builder::enaSrdSupported)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnaSrdSupported") .unmarshallLocationName("enaSrdSupported").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NETWORK_PERFORMANCE_FIELD, MAXIMUM_NETWORK_INTERFACES_FIELD, MAXIMUM_NETWORK_CARDS_FIELD, DEFAULT_NETWORK_CARD_INDEX_FIELD, NETWORK_CARDS_FIELD, IPV4_ADDRESSES_PER_INTERFACE_FIELD, IPV6_ADDRESSES_PER_INTERFACE_FIELD, IPV6_SUPPORTED_FIELD, ENA_SUPPORT_FIELD, EFA_SUPPORTED_FIELD, EFA_INFO_FIELD, ENCRYPTION_IN_TRANSIT_SUPPORTED_FIELD, ENA_SRD_SUPPORTED_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("NetworkPerformance", NETWORK_PERFORMANCE_FIELD); put("MaximumNetworkInterfaces", MAXIMUM_NETWORK_INTERFACES_FIELD); put("MaximumNetworkCards", MAXIMUM_NETWORK_CARDS_FIELD); put("DefaultNetworkCardIndex", DEFAULT_NETWORK_CARD_INDEX_FIELD); put("NetworkCards", NETWORK_CARDS_FIELD); put("Ipv4AddressesPerInterface", IPV4_ADDRESSES_PER_INTERFACE_FIELD); put("Ipv6AddressesPerInterface", IPV6_ADDRESSES_PER_INTERFACE_FIELD); put("Ipv6Supported", IPV6_SUPPORTED_FIELD); put("EnaSupport", ENA_SUPPORT_FIELD); put("EfaSupported", EFA_SUPPORTED_FIELD); put("EfaInfo", EFA_INFO_FIELD); put("EncryptionInTransitSupported", ENCRYPTION_IN_TRANSIT_SUPPORTED_FIELD); put("EnaSrdSupported", ENA_SRD_SUPPORTED_FIELD); } }); private static final long serialVersionUID = 1L; private final String networkPerformance; private final Integer maximumNetworkInterfaces; private final Integer maximumNetworkCards; private final Integer defaultNetworkCardIndex; private final List networkCards; private final Integer ipv4AddressesPerInterface; private final Integer ipv6AddressesPerInterface; private final Boolean ipv6Supported; private final String enaSupport; private final Boolean efaSupported; private final EfaInfo efaInfo; private final Boolean encryptionInTransitSupported; private final Boolean enaSrdSupported; private NetworkInfo(BuilderImpl builder) { this.networkPerformance = builder.networkPerformance; this.maximumNetworkInterfaces = builder.maximumNetworkInterfaces; this.maximumNetworkCards = builder.maximumNetworkCards; this.defaultNetworkCardIndex = builder.defaultNetworkCardIndex; this.networkCards = builder.networkCards; this.ipv4AddressesPerInterface = builder.ipv4AddressesPerInterface; this.ipv6AddressesPerInterface = builder.ipv6AddressesPerInterface; this.ipv6Supported = builder.ipv6Supported; this.enaSupport = builder.enaSupport; this.efaSupported = builder.efaSupported; this.efaInfo = builder.efaInfo; this.encryptionInTransitSupported = builder.encryptionInTransitSupported; this.enaSrdSupported = builder.enaSrdSupported; } /** *

* The network performance. *

* * @return The network performance. */ public final String networkPerformance() { return networkPerformance; } /** *

* The maximum number of network interfaces for the instance type. *

* * @return The maximum number of network interfaces for the instance type. */ public final Integer maximumNetworkInterfaces() { return maximumNetworkInterfaces; } /** *

* The maximum number of physical network cards that can be allocated to the instance. *

* * @return The maximum number of physical network cards that can be allocated to the instance. */ public final Integer maximumNetworkCards() { return maximumNetworkCards; } /** *

* The index of the default network card, starting at 0. *

* * @return The index of the default network card, starting at 0. */ public final Integer defaultNetworkCardIndex() { return defaultNetworkCardIndex; } /** * For responses, this returns true if the service returned a value for the NetworkCards property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasNetworkCards() { return networkCards != null && !(networkCards instanceof SdkAutoConstructList); } /** *

* Describes the network cards for the instance type. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasNetworkCards} method. *

* * @return Describes the network cards for the instance type. */ public final List networkCards() { return networkCards; } /** *

* The maximum number of IPv4 addresses per network interface. *

* * @return The maximum number of IPv4 addresses per network interface. */ public final Integer ipv4AddressesPerInterface() { return ipv4AddressesPerInterface; } /** *

* The maximum number of IPv6 addresses per network interface. *

* * @return The maximum number of IPv6 addresses per network interface. */ public final Integer ipv6AddressesPerInterface() { return ipv6AddressesPerInterface; } /** *

* Indicates whether IPv6 is supported. *

* * @return Indicates whether IPv6 is supported. */ public final Boolean ipv6Supported() { return ipv6Supported; } /** *

* Indicates whether Elastic Network Adapter (ENA) is supported. *

*

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

* * @return Indicates whether Elastic Network Adapter (ENA) is supported. * @see EnaSupport */ public final EnaSupport enaSupport() { return EnaSupport.fromValue(enaSupport); } /** *

* Indicates whether Elastic Network Adapter (ENA) is supported. *

*

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

* * @return Indicates whether Elastic Network Adapter (ENA) is supported. * @see EnaSupport */ public final String enaSupportAsString() { return enaSupport; } /** *

* Indicates whether Elastic Fabric Adapter (EFA) is supported. *

* * @return Indicates whether Elastic Fabric Adapter (EFA) is supported. */ public final Boolean efaSupported() { return efaSupported; } /** *

* Describes the Elastic Fabric Adapters for the instance type. *

* * @return Describes the Elastic Fabric Adapters for the instance type. */ public final EfaInfo efaInfo() { return efaInfo; } /** *

* Indicates whether the instance type automatically encrypts in-transit traffic between instances. *

* * @return Indicates whether the instance type automatically encrypts in-transit traffic between instances. */ public final Boolean encryptionInTransitSupported() { return encryptionInTransitSupported; } /** *

* Indicates whether the instance type supports ENA Express. ENA Express uses Amazon Web Services Scalable Reliable * Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network * traffic between EC2 instances. *

* * @return Indicates whether the instance type supports ENA Express. ENA Express uses Amazon Web Services Scalable * Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail * latency of network traffic between EC2 instances. */ public final Boolean enaSrdSupported() { return enaSrdSupported; } @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(networkPerformance()); hashCode = 31 * hashCode + Objects.hashCode(maximumNetworkInterfaces()); hashCode = 31 * hashCode + Objects.hashCode(maximumNetworkCards()); hashCode = 31 * hashCode + Objects.hashCode(defaultNetworkCardIndex()); hashCode = 31 * hashCode + Objects.hashCode(hasNetworkCards() ? networkCards() : null); hashCode = 31 * hashCode + Objects.hashCode(ipv4AddressesPerInterface()); hashCode = 31 * hashCode + Objects.hashCode(ipv6AddressesPerInterface()); hashCode = 31 * hashCode + Objects.hashCode(ipv6Supported()); hashCode = 31 * hashCode + Objects.hashCode(enaSupportAsString()); hashCode = 31 * hashCode + Objects.hashCode(efaSupported()); hashCode = 31 * hashCode + Objects.hashCode(efaInfo()); hashCode = 31 * hashCode + Objects.hashCode(encryptionInTransitSupported()); hashCode = 31 * hashCode + Objects.hashCode(enaSrdSupported()); 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 NetworkInfo)) { return false; } NetworkInfo other = (NetworkInfo) obj; return Objects.equals(networkPerformance(), other.networkPerformance()) && Objects.equals(maximumNetworkInterfaces(), other.maximumNetworkInterfaces()) && Objects.equals(maximumNetworkCards(), other.maximumNetworkCards()) && Objects.equals(defaultNetworkCardIndex(), other.defaultNetworkCardIndex()) && hasNetworkCards() == other.hasNetworkCards() && Objects.equals(networkCards(), other.networkCards()) && Objects.equals(ipv4AddressesPerInterface(), other.ipv4AddressesPerInterface()) && Objects.equals(ipv6AddressesPerInterface(), other.ipv6AddressesPerInterface()) && Objects.equals(ipv6Supported(), other.ipv6Supported()) && Objects.equals(enaSupportAsString(), other.enaSupportAsString()) && Objects.equals(efaSupported(), other.efaSupported()) && Objects.equals(efaInfo(), other.efaInfo()) && Objects.equals(encryptionInTransitSupported(), other.encryptionInTransitSupported()) && Objects.equals(enaSrdSupported(), other.enaSrdSupported()); } /** * 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("NetworkInfo").add("NetworkPerformance", networkPerformance()) .add("MaximumNetworkInterfaces", maximumNetworkInterfaces()).add("MaximumNetworkCards", maximumNetworkCards()) .add("DefaultNetworkCardIndex", defaultNetworkCardIndex()) .add("NetworkCards", hasNetworkCards() ? networkCards() : null) .add("Ipv4AddressesPerInterface", ipv4AddressesPerInterface()) .add("Ipv6AddressesPerInterface", ipv6AddressesPerInterface()).add("Ipv6Supported", ipv6Supported()) .add("EnaSupport", enaSupportAsString()).add("EfaSupported", efaSupported()).add("EfaInfo", efaInfo()) .add("EncryptionInTransitSupported", encryptionInTransitSupported()).add("EnaSrdSupported", enaSrdSupported()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "NetworkPerformance": return Optional.ofNullable(clazz.cast(networkPerformance())); case "MaximumNetworkInterfaces": return Optional.ofNullable(clazz.cast(maximumNetworkInterfaces())); case "MaximumNetworkCards": return Optional.ofNullable(clazz.cast(maximumNetworkCards())); case "DefaultNetworkCardIndex": return Optional.ofNullable(clazz.cast(defaultNetworkCardIndex())); case "NetworkCards": return Optional.ofNullable(clazz.cast(networkCards())); case "Ipv4AddressesPerInterface": return Optional.ofNullable(clazz.cast(ipv4AddressesPerInterface())); case "Ipv6AddressesPerInterface": return Optional.ofNullable(clazz.cast(ipv6AddressesPerInterface())); case "Ipv6Supported": return Optional.ofNullable(clazz.cast(ipv6Supported())); case "EnaSupport": return Optional.ofNullable(clazz.cast(enaSupportAsString())); case "EfaSupported": return Optional.ofNullable(clazz.cast(efaSupported())); case "EfaInfo": return Optional.ofNullable(clazz.cast(efaInfo())); case "EncryptionInTransitSupported": return Optional.ofNullable(clazz.cast(encryptionInTransitSupported())); case "EnaSrdSupported": return Optional.ofNullable(clazz.cast(enaSrdSupported())); 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((NetworkInfo) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The network performance. *

* * @param networkPerformance * The network performance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkPerformance(String networkPerformance); /** *

* The maximum number of network interfaces for the instance type. *

* * @param maximumNetworkInterfaces * The maximum number of network interfaces for the instance type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumNetworkInterfaces(Integer maximumNetworkInterfaces); /** *

* The maximum number of physical network cards that can be allocated to the instance. *

* * @param maximumNetworkCards * The maximum number of physical network cards that can be allocated to the instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumNetworkCards(Integer maximumNetworkCards); /** *

* The index of the default network card, starting at 0. *

* * @param defaultNetworkCardIndex * The index of the default network card, starting at 0. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultNetworkCardIndex(Integer defaultNetworkCardIndex); /** *

* Describes the network cards for the instance type. *

* * @param networkCards * Describes the network cards for the instance type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkCards(Collection networkCards); /** *

* Describes the network cards for the instance type. *

* * @param networkCards * Describes the network cards for the instance type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkCards(NetworkCardInfo... networkCards); /** *

* Describes the network cards for the instance type. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ec2.model.NetworkCardInfo.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.ec2.model.NetworkCardInfo#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ec2.model.NetworkCardInfo.Builder#build()} is called immediately and * its result is passed to {@link #networkCards(List)}. * * @param networkCards * a consumer that will call methods on * {@link software.amazon.awssdk.services.ec2.model.NetworkCardInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #networkCards(java.util.Collection) */ Builder networkCards(Consumer... networkCards); /** *

* The maximum number of IPv4 addresses per network interface. *

* * @param ipv4AddressesPerInterface * The maximum number of IPv4 addresses per network interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv4AddressesPerInterface(Integer ipv4AddressesPerInterface); /** *

* The maximum number of IPv6 addresses per network interface. *

* * @param ipv6AddressesPerInterface * The maximum number of IPv6 addresses per network interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv6AddressesPerInterface(Integer ipv6AddressesPerInterface); /** *

* Indicates whether IPv6 is supported. *

* * @param ipv6Supported * Indicates whether IPv6 is supported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipv6Supported(Boolean ipv6Supported); /** *

* Indicates whether Elastic Network Adapter (ENA) is supported. *

* * @param enaSupport * Indicates whether Elastic Network Adapter (ENA) is supported. * @see EnaSupport * @return Returns a reference to this object so that method calls can be chained together. * @see EnaSupport */ Builder enaSupport(String enaSupport); /** *

* Indicates whether Elastic Network Adapter (ENA) is supported. *

* * @param enaSupport * Indicates whether Elastic Network Adapter (ENA) is supported. * @see EnaSupport * @return Returns a reference to this object so that method calls can be chained together. * @see EnaSupport */ Builder enaSupport(EnaSupport enaSupport); /** *

* Indicates whether Elastic Fabric Adapter (EFA) is supported. *

* * @param efaSupported * Indicates whether Elastic Fabric Adapter (EFA) is supported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder efaSupported(Boolean efaSupported); /** *

* Describes the Elastic Fabric Adapters for the instance type. *

* * @param efaInfo * Describes the Elastic Fabric Adapters for the instance type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder efaInfo(EfaInfo efaInfo); /** *

* Describes the Elastic Fabric Adapters for the instance type. *

* This is a convenience method that creates an instance of the {@link EfaInfo.Builder} avoiding the need to * create one manually via {@link EfaInfo#builder()}. * *

* When the {@link Consumer} completes, {@link EfaInfo.Builder#build()} is called immediately and its result is * passed to {@link #efaInfo(EfaInfo)}. * * @param efaInfo * a consumer that will call methods on {@link EfaInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #efaInfo(EfaInfo) */ default Builder efaInfo(Consumer efaInfo) { return efaInfo(EfaInfo.builder().applyMutation(efaInfo).build()); } /** *

* Indicates whether the instance type automatically encrypts in-transit traffic between instances. *

* * @param encryptionInTransitSupported * Indicates whether the instance type automatically encrypts in-transit traffic between instances. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionInTransitSupported(Boolean encryptionInTransitSupported); /** *

* Indicates whether the instance type supports ENA Express. ENA Express uses Amazon Web Services Scalable * Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail * latency of network traffic between EC2 instances. *

* * @param enaSrdSupported * Indicates whether the instance type supports ENA Express. ENA Express uses Amazon Web Services * Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and * minimize tail latency of network traffic between EC2 instances. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enaSrdSupported(Boolean enaSrdSupported); } static final class BuilderImpl implements Builder { private String networkPerformance; private Integer maximumNetworkInterfaces; private Integer maximumNetworkCards; private Integer defaultNetworkCardIndex; private List networkCards = DefaultSdkAutoConstructList.getInstance(); private Integer ipv4AddressesPerInterface; private Integer ipv6AddressesPerInterface; private Boolean ipv6Supported; private String enaSupport; private Boolean efaSupported; private EfaInfo efaInfo; private Boolean encryptionInTransitSupported; private Boolean enaSrdSupported; private BuilderImpl() { } private BuilderImpl(NetworkInfo model) { networkPerformance(model.networkPerformance); maximumNetworkInterfaces(model.maximumNetworkInterfaces); maximumNetworkCards(model.maximumNetworkCards); defaultNetworkCardIndex(model.defaultNetworkCardIndex); networkCards(model.networkCards); ipv4AddressesPerInterface(model.ipv4AddressesPerInterface); ipv6AddressesPerInterface(model.ipv6AddressesPerInterface); ipv6Supported(model.ipv6Supported); enaSupport(model.enaSupport); efaSupported(model.efaSupported); efaInfo(model.efaInfo); encryptionInTransitSupported(model.encryptionInTransitSupported); enaSrdSupported(model.enaSrdSupported); } public final String getNetworkPerformance() { return networkPerformance; } public final void setNetworkPerformance(String networkPerformance) { this.networkPerformance = networkPerformance; } @Override public final Builder networkPerformance(String networkPerformance) { this.networkPerformance = networkPerformance; return this; } public final Integer getMaximumNetworkInterfaces() { return maximumNetworkInterfaces; } public final void setMaximumNetworkInterfaces(Integer maximumNetworkInterfaces) { this.maximumNetworkInterfaces = maximumNetworkInterfaces; } @Override public final Builder maximumNetworkInterfaces(Integer maximumNetworkInterfaces) { this.maximumNetworkInterfaces = maximumNetworkInterfaces; return this; } public final Integer getMaximumNetworkCards() { return maximumNetworkCards; } public final void setMaximumNetworkCards(Integer maximumNetworkCards) { this.maximumNetworkCards = maximumNetworkCards; } @Override public final Builder maximumNetworkCards(Integer maximumNetworkCards) { this.maximumNetworkCards = maximumNetworkCards; return this; } public final Integer getDefaultNetworkCardIndex() { return defaultNetworkCardIndex; } public final void setDefaultNetworkCardIndex(Integer defaultNetworkCardIndex) { this.defaultNetworkCardIndex = defaultNetworkCardIndex; } @Override public final Builder defaultNetworkCardIndex(Integer defaultNetworkCardIndex) { this.defaultNetworkCardIndex = defaultNetworkCardIndex; return this; } public final List getNetworkCards() { List result = NetworkCardInfoListCopier.copyToBuilder(this.networkCards); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setNetworkCards(Collection networkCards) { this.networkCards = NetworkCardInfoListCopier.copyFromBuilder(networkCards); } @Override public final Builder networkCards(Collection networkCards) { this.networkCards = NetworkCardInfoListCopier.copy(networkCards); return this; } @Override @SafeVarargs public final Builder networkCards(NetworkCardInfo... networkCards) { networkCards(Arrays.asList(networkCards)); return this; } @Override @SafeVarargs public final Builder networkCards(Consumer... networkCards) { networkCards(Stream.of(networkCards).map(c -> NetworkCardInfo.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Integer getIpv4AddressesPerInterface() { return ipv4AddressesPerInterface; } public final void setIpv4AddressesPerInterface(Integer ipv4AddressesPerInterface) { this.ipv4AddressesPerInterface = ipv4AddressesPerInterface; } @Override public final Builder ipv4AddressesPerInterface(Integer ipv4AddressesPerInterface) { this.ipv4AddressesPerInterface = ipv4AddressesPerInterface; return this; } public final Integer getIpv6AddressesPerInterface() { return ipv6AddressesPerInterface; } public final void setIpv6AddressesPerInterface(Integer ipv6AddressesPerInterface) { this.ipv6AddressesPerInterface = ipv6AddressesPerInterface; } @Override public final Builder ipv6AddressesPerInterface(Integer ipv6AddressesPerInterface) { this.ipv6AddressesPerInterface = ipv6AddressesPerInterface; return this; } public final Boolean getIpv6Supported() { return ipv6Supported; } public final void setIpv6Supported(Boolean ipv6Supported) { this.ipv6Supported = ipv6Supported; } @Override public final Builder ipv6Supported(Boolean ipv6Supported) { this.ipv6Supported = ipv6Supported; return this; } public final String getEnaSupport() { return enaSupport; } public final void setEnaSupport(String enaSupport) { this.enaSupport = enaSupport; } @Override public final Builder enaSupport(String enaSupport) { this.enaSupport = enaSupport; return this; } @Override public final Builder enaSupport(EnaSupport enaSupport) { this.enaSupport(enaSupport == null ? null : enaSupport.toString()); return this; } public final Boolean getEfaSupported() { return efaSupported; } public final void setEfaSupported(Boolean efaSupported) { this.efaSupported = efaSupported; } @Override public final Builder efaSupported(Boolean efaSupported) { this.efaSupported = efaSupported; return this; } public final EfaInfo.Builder getEfaInfo() { return efaInfo != null ? efaInfo.toBuilder() : null; } public final void setEfaInfo(EfaInfo.BuilderImpl efaInfo) { this.efaInfo = efaInfo != null ? efaInfo.build() : null; } @Override public final Builder efaInfo(EfaInfo efaInfo) { this.efaInfo = efaInfo; return this; } public final Boolean getEncryptionInTransitSupported() { return encryptionInTransitSupported; } public final void setEncryptionInTransitSupported(Boolean encryptionInTransitSupported) { this.encryptionInTransitSupported = encryptionInTransitSupported; } @Override public final Builder encryptionInTransitSupported(Boolean encryptionInTransitSupported) { this.encryptionInTransitSupported = encryptionInTransitSupported; return this; } public final Boolean getEnaSrdSupported() { return enaSrdSupported; } public final void setEnaSrdSupported(Boolean enaSrdSupported) { this.enaSrdSupported = enaSrdSupported; } @Override public final Builder enaSrdSupported(Boolean enaSrdSupported) { this.enaSrdSupported = enaSrdSupported; return this; } @Override public NetworkInfo build() { return new NetworkInfo(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy