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

software.amazon.awssdk.services.ec2.model.LocalGatewayVirtualInterface 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

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.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 a local gateway virtual interface. *

*/ @Generated("software.amazon.awssdk:codegen") public final class LocalGatewayVirtualInterface implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField LOCAL_GATEWAY_VIRTUAL_INTERFACE_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("LocalGatewayVirtualInterfaceId") .getter(getter(LocalGatewayVirtualInterface::localGatewayVirtualInterfaceId)) .setter(setter(Builder::localGatewayVirtualInterfaceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalGatewayVirtualInterfaceId") .unmarshallLocationName("localGatewayVirtualInterfaceId").build()).build(); private static final SdkField LOCAL_GATEWAY_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("LocalGatewayId") .getter(getter(LocalGatewayVirtualInterface::localGatewayId)) .setter(setter(Builder::localGatewayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalGatewayId") .unmarshallLocationName("localGatewayId").build()).build(); private static final SdkField VLAN_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Vlan") .getter(getter(LocalGatewayVirtualInterface::vlan)) .setter(setter(Builder::vlan)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Vlan") .unmarshallLocationName("vlan").build()).build(); private static final SdkField LOCAL_ADDRESS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("LocalAddress") .getter(getter(LocalGatewayVirtualInterface::localAddress)) .setter(setter(Builder::localAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalAddress") .unmarshallLocationName("localAddress").build()).build(); private static final SdkField PEER_ADDRESS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("PeerAddress") .getter(getter(LocalGatewayVirtualInterface::peerAddress)) .setter(setter(Builder::peerAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PeerAddress") .unmarshallLocationName("peerAddress").build()).build(); private static final SdkField LOCAL_BGP_ASN_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("LocalBgpAsn") .getter(getter(LocalGatewayVirtualInterface::localBgpAsn)) .setter(setter(Builder::localBgpAsn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalBgpAsn") .unmarshallLocationName("localBgpAsn").build()).build(); private static final SdkField PEER_BGP_ASN_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("PeerBgpAsn") .getter(getter(LocalGatewayVirtualInterface::peerBgpAsn)) .setter(setter(Builder::peerBgpAsn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PeerBgpAsn") .unmarshallLocationName("peerBgpAsn").build()).build(); private static final SdkField OWNER_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("OwnerId") .getter(getter(LocalGatewayVirtualInterface::ownerId)) .setter(setter(Builder::ownerId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerId") .unmarshallLocationName("ownerId").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(LocalGatewayVirtualInterface::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TagSet") .unmarshallLocationName("tagSet").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( LOCAL_GATEWAY_VIRTUAL_INTERFACE_ID_FIELD, LOCAL_GATEWAY_ID_FIELD, VLAN_FIELD, LOCAL_ADDRESS_FIELD, PEER_ADDRESS_FIELD, LOCAL_BGP_ASN_FIELD, PEER_BGP_ASN_FIELD, OWNER_ID_FIELD, TAGS_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("LocalGatewayVirtualInterfaceId", LOCAL_GATEWAY_VIRTUAL_INTERFACE_ID_FIELD); put("LocalGatewayId", LOCAL_GATEWAY_ID_FIELD); put("Vlan", VLAN_FIELD); put("LocalAddress", LOCAL_ADDRESS_FIELD); put("PeerAddress", PEER_ADDRESS_FIELD); put("LocalBgpAsn", LOCAL_BGP_ASN_FIELD); put("PeerBgpAsn", PEER_BGP_ASN_FIELD); put("OwnerId", OWNER_ID_FIELD); put("TagSet", TAGS_FIELD); } }); private static final long serialVersionUID = 1L; private final String localGatewayVirtualInterfaceId; private final String localGatewayId; private final Integer vlan; private final String localAddress; private final String peerAddress; private final Integer localBgpAsn; private final Integer peerBgpAsn; private final String ownerId; private final List tags; private LocalGatewayVirtualInterface(BuilderImpl builder) { this.localGatewayVirtualInterfaceId = builder.localGatewayVirtualInterfaceId; this.localGatewayId = builder.localGatewayId; this.vlan = builder.vlan; this.localAddress = builder.localAddress; this.peerAddress = builder.peerAddress; this.localBgpAsn = builder.localBgpAsn; this.peerBgpAsn = builder.peerBgpAsn; this.ownerId = builder.ownerId; this.tags = builder.tags; } /** *

* The ID of the virtual interface. *

* * @return The ID of the virtual interface. */ public final String localGatewayVirtualInterfaceId() { return localGatewayVirtualInterfaceId; } /** *

* The ID of the local gateway. *

* * @return The ID of the local gateway. */ public final String localGatewayId() { return localGatewayId; } /** *

* The ID of the VLAN. *

* * @return The ID of the VLAN. */ public final Integer vlan() { return vlan; } /** *

* The local address. *

* * @return The local address. */ public final String localAddress() { return localAddress; } /** *

* The peer address. *

* * @return The peer address. */ public final String peerAddress() { return peerAddress; } /** *

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

* * @return The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. */ public final Integer localBgpAsn() { return localBgpAsn; } /** *

* The peer BGP ASN. *

* * @return The peer BGP ASN. */ public final Integer peerBgpAsn() { return peerBgpAsn; } /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

* * @return The ID of the Amazon Web Services account that owns the local gateway virtual interface. */ public final String ownerId() { return ownerId; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* The tags assigned to the virtual interface. *

*

* 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 #hasTags} method. *

* * @return The tags assigned to the virtual interface. */ public final List tags() { return tags; } @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(localGatewayVirtualInterfaceId()); hashCode = 31 * hashCode + Objects.hashCode(localGatewayId()); hashCode = 31 * hashCode + Objects.hashCode(vlan()); hashCode = 31 * hashCode + Objects.hashCode(localAddress()); hashCode = 31 * hashCode + Objects.hashCode(peerAddress()); hashCode = 31 * hashCode + Objects.hashCode(localBgpAsn()); hashCode = 31 * hashCode + Objects.hashCode(peerBgpAsn()); hashCode = 31 * hashCode + Objects.hashCode(ownerId()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); 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 LocalGatewayVirtualInterface)) { return false; } LocalGatewayVirtualInterface other = (LocalGatewayVirtualInterface) obj; return Objects.equals(localGatewayVirtualInterfaceId(), other.localGatewayVirtualInterfaceId()) && Objects.equals(localGatewayId(), other.localGatewayId()) && Objects.equals(vlan(), other.vlan()) && Objects.equals(localAddress(), other.localAddress()) && Objects.equals(peerAddress(), other.peerAddress()) && Objects.equals(localBgpAsn(), other.localBgpAsn()) && Objects.equals(peerBgpAsn(), other.peerBgpAsn()) && Objects.equals(ownerId(), other.ownerId()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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("LocalGatewayVirtualInterface") .add("LocalGatewayVirtualInterfaceId", localGatewayVirtualInterfaceId()).add("LocalGatewayId", localGatewayId()) .add("Vlan", vlan()).add("LocalAddress", localAddress()).add("PeerAddress", peerAddress()) .add("LocalBgpAsn", localBgpAsn()).add("PeerBgpAsn", peerBgpAsn()).add("OwnerId", ownerId()) .add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "LocalGatewayVirtualInterfaceId": return Optional.ofNullable(clazz.cast(localGatewayVirtualInterfaceId())); case "LocalGatewayId": return Optional.ofNullable(clazz.cast(localGatewayId())); case "Vlan": return Optional.ofNullable(clazz.cast(vlan())); case "LocalAddress": return Optional.ofNullable(clazz.cast(localAddress())); case "PeerAddress": return Optional.ofNullable(clazz.cast(peerAddress())); case "LocalBgpAsn": return Optional.ofNullable(clazz.cast(localBgpAsn())); case "PeerBgpAsn": return Optional.ofNullable(clazz.cast(peerBgpAsn())); case "OwnerId": return Optional.ofNullable(clazz.cast(ownerId())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); 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((LocalGatewayVirtualInterface) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the virtual interface. *

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

* The ID of the local gateway. *

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

* The ID of the VLAN. *

* * @param vlan * The ID of the VLAN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vlan(Integer vlan); /** *

* The local address. *

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

* The peer address. *

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

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

* * @param localBgpAsn * The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localBgpAsn(Integer localBgpAsn); /** *

* The peer BGP ASN. *

* * @param peerBgpAsn * The peer BGP ASN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder peerBgpAsn(Integer peerBgpAsn); /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

* * @param ownerId * The ID of the Amazon Web Services account that owns the local gateway virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerId(String ownerId); /** *

* The tags assigned to the virtual interface. *

* * @param tags * The tags assigned to the virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* The tags assigned to the virtual interface. *

* * @param tags * The tags assigned to the virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* The tags assigned to the virtual interface. *

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

* When the {@link Consumer} completes, {@link software.amazon.awssdk.services.ec2.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.ec2.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); } static final class BuilderImpl implements Builder { private String localGatewayVirtualInterfaceId; private String localGatewayId; private Integer vlan; private String localAddress; private String peerAddress; private Integer localBgpAsn; private Integer peerBgpAsn; private String ownerId; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(LocalGatewayVirtualInterface model) { localGatewayVirtualInterfaceId(model.localGatewayVirtualInterfaceId); localGatewayId(model.localGatewayId); vlan(model.vlan); localAddress(model.localAddress); peerAddress(model.peerAddress); localBgpAsn(model.localBgpAsn); peerBgpAsn(model.peerBgpAsn); ownerId(model.ownerId); tags(model.tags); } public final String getLocalGatewayVirtualInterfaceId() { return localGatewayVirtualInterfaceId; } public final void setLocalGatewayVirtualInterfaceId(String localGatewayVirtualInterfaceId) { this.localGatewayVirtualInterfaceId = localGatewayVirtualInterfaceId; } @Override public final Builder localGatewayVirtualInterfaceId(String localGatewayVirtualInterfaceId) { this.localGatewayVirtualInterfaceId = localGatewayVirtualInterfaceId; return this; } public final String getLocalGatewayId() { return localGatewayId; } public final void setLocalGatewayId(String localGatewayId) { this.localGatewayId = localGatewayId; } @Override public final Builder localGatewayId(String localGatewayId) { this.localGatewayId = localGatewayId; return this; } public final Integer getVlan() { return vlan; } public final void setVlan(Integer vlan) { this.vlan = vlan; } @Override public final Builder vlan(Integer vlan) { this.vlan = vlan; return this; } public final String getLocalAddress() { return localAddress; } public final void setLocalAddress(String localAddress) { this.localAddress = localAddress; } @Override public final Builder localAddress(String localAddress) { this.localAddress = localAddress; return this; } public final String getPeerAddress() { return peerAddress; } public final void setPeerAddress(String peerAddress) { this.peerAddress = peerAddress; } @Override public final Builder peerAddress(String peerAddress) { this.peerAddress = peerAddress; return this; } public final Integer getLocalBgpAsn() { return localBgpAsn; } public final void setLocalBgpAsn(Integer localBgpAsn) { this.localBgpAsn = localBgpAsn; } @Override public final Builder localBgpAsn(Integer localBgpAsn) { this.localBgpAsn = localBgpAsn; return this; } public final Integer getPeerBgpAsn() { return peerBgpAsn; } public final void setPeerBgpAsn(Integer peerBgpAsn) { this.peerBgpAsn = peerBgpAsn; } @Override public final Builder peerBgpAsn(Integer peerBgpAsn) { this.peerBgpAsn = peerBgpAsn; return this; } public final String getOwnerId() { return ownerId; } public final void setOwnerId(String ownerId) { this.ownerId = ownerId; } @Override public final Builder ownerId(String ownerId) { this.ownerId = ownerId; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } @Override public LocalGatewayVirtualInterface build() { return new LocalGatewayVirtualInterface(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy