software.amazon.awssdk.services.networkmanager.model.ConnectPeerBgpConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of networkmanager Show documentation
Show all versions of networkmanager Show documentation
The AWS Java SDK for NetworkManager module holds the client classes that are used for
communicating with NetworkManager.
/*
* 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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy