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

software.amazon.awssdk.services.networkmanager.model.ConnectPeerBgpConfiguration Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.networkmanager.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
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 core network BGP configuration. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ConnectPeerBgpConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CORE_NETWORK_ASN_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("CoreNetworkAsn").getter(getter(ConnectPeerBgpConfiguration::coreNetworkAsn)) .setter(setter(Builder::coreNetworkAsn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CoreNetworkAsn").build()).build(); private static final SdkField PEER_ASN_FIELD = SdkField. builder(MarshallingType.LONG).memberName("PeerAsn") .getter(getter(ConnectPeerBgpConfiguration::peerAsn)).setter(setter(Builder::peerAsn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PeerAsn").build()).build(); private static final SdkField CORE_NETWORK_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CoreNetworkAddress").getter(getter(ConnectPeerBgpConfiguration::coreNetworkAddress)) .setter(setter(Builder::coreNetworkAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CoreNetworkAddress").build()) .build(); private static final SdkField PEER_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("PeerAddress").getter(getter(ConnectPeerBgpConfiguration::peerAddress)) .setter(setter(Builder::peerAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PeerAddress").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CORE_NETWORK_ASN_FIELD, PEER_ASN_FIELD, CORE_NETWORK_ADDRESS_FIELD, PEER_ADDRESS_FIELD)); private static final long serialVersionUID = 1L; private final Long coreNetworkAsn; private final Long peerAsn; private final String coreNetworkAddress; private final String peerAddress; private ConnectPeerBgpConfiguration(BuilderImpl builder) { this.coreNetworkAsn = builder.coreNetworkAsn; this.peerAsn = builder.peerAsn; this.coreNetworkAddress = builder.coreNetworkAddress; this.peerAddress = builder.peerAddress; } /** *

* The ASN of the Coret Network. *

* * @return The ASN of the Coret Network. */ public final Long coreNetworkAsn() { return coreNetworkAsn; } /** *

* The ASN of the Connect peer. *

* * @return The ASN of the Connect peer. */ public final Long peerAsn() { return peerAsn; } /** *

* The address of a core network. *

* * @return The address of a core network. */ public final String coreNetworkAddress() { return coreNetworkAddress; } /** *

* The address of a core network Connect peer. *

* * @return The address of a core network Connect peer. */ public final String peerAddress() { return peerAddress; } @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(coreNetworkAsn()); hashCode = 31 * hashCode + Objects.hashCode(peerAsn()); hashCode = 31 * hashCode + Objects.hashCode(coreNetworkAddress()); hashCode = 31 * hashCode + Objects.hashCode(peerAddress()); 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 ConnectPeerBgpConfiguration)) { return false; } ConnectPeerBgpConfiguration other = (ConnectPeerBgpConfiguration) obj; return Objects.equals(coreNetworkAsn(), other.coreNetworkAsn()) && Objects.equals(peerAsn(), other.peerAsn()) && Objects.equals(coreNetworkAddress(), other.coreNetworkAddress()) && Objects.equals(peerAddress(), other.peerAddress()); } /** * 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("ConnectPeerBgpConfiguration").add("CoreNetworkAsn", coreNetworkAsn()).add("PeerAsn", peerAsn()) .add("CoreNetworkAddress", coreNetworkAddress()).add("PeerAddress", peerAddress()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CoreNetworkAsn": return Optional.ofNullable(clazz.cast(coreNetworkAsn())); case "PeerAsn": return Optional.ofNullable(clazz.cast(peerAsn())); case "CoreNetworkAddress": return Optional.ofNullable(clazz.cast(coreNetworkAddress())); case "PeerAddress": return Optional.ofNullable(clazz.cast(peerAddress())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ConnectPeerBgpConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ASN of the Coret Network. *

* * @param coreNetworkAsn * The ASN of the Coret Network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder coreNetworkAsn(Long coreNetworkAsn); /** *

* The ASN of the Connect peer. *

* * @param peerAsn * The ASN of the Connect peer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder peerAsn(Long peerAsn); /** *

* The address of a core network. *

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

* The address of a core network Connect peer. *

* * @param peerAddress * The address of a core network Connect peer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder peerAddress(String peerAddress); } static final class BuilderImpl implements Builder { private Long coreNetworkAsn; private Long peerAsn; private String coreNetworkAddress; private String peerAddress; private BuilderImpl() { } private BuilderImpl(ConnectPeerBgpConfiguration model) { coreNetworkAsn(model.coreNetworkAsn); peerAsn(model.peerAsn); coreNetworkAddress(model.coreNetworkAddress); peerAddress(model.peerAddress); } public final Long getCoreNetworkAsn() { return coreNetworkAsn; } public final void setCoreNetworkAsn(Long coreNetworkAsn) { this.coreNetworkAsn = coreNetworkAsn; } @Override public final Builder coreNetworkAsn(Long coreNetworkAsn) { this.coreNetworkAsn = coreNetworkAsn; return this; } public final Long getPeerAsn() { return peerAsn; } public final void setPeerAsn(Long peerAsn) { this.peerAsn = peerAsn; } @Override public final Builder peerAsn(Long peerAsn) { this.peerAsn = peerAsn; return this; } public final String getCoreNetworkAddress() { return coreNetworkAddress; } public final void setCoreNetworkAddress(String coreNetworkAddress) { this.coreNetworkAddress = coreNetworkAddress; } @Override public final Builder coreNetworkAddress(String coreNetworkAddress) { this.coreNetworkAddress = coreNetworkAddress; 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; } @Override public ConnectPeerBgpConfiguration build() { return new ConnectPeerBgpConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy