software.amazon.awssdk.services.directconnect.model.Lag Maven / Gradle / Ivy
Show all versions of directconnect Show documentation
/*
* 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.directconnect.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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.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;
/**
*
* Information about a link aggregation group (LAG).
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Lag implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CONNECTIONS_BANDWIDTH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("connectionsBandwidth").getter(getter(Lag::connectionsBandwidth))
.setter(setter(Builder::connectionsBandwidth))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionsBandwidth").build())
.build();
private static final SdkField NUMBER_OF_CONNECTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("numberOfConnections").getter(getter(Lag::numberOfConnections))
.setter(setter(Builder::numberOfConnections))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numberOfConnections").build())
.build();
private static final SdkField LAG_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("lagId")
.getter(getter(Lag::lagId)).setter(setter(Builder::lagId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lagId").build()).build();
private static final SdkField OWNER_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ownerAccount").getter(getter(Lag::ownerAccount)).setter(setter(Builder::ownerAccount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerAccount").build()).build();
private static final SdkField LAG_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("lagName").getter(getter(Lag::lagName)).setter(setter(Builder::lagName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lagName").build()).build();
private static final SdkField LAG_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("lagState").getter(getter(Lag::lagStateAsString)).setter(setter(Builder::lagState))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lagState").build()).build();
private static final SdkField LOCATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("location").getter(getter(Lag::location)).setter(setter(Builder::location))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("location").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("region")
.getter(getter(Lag::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("region").build()).build();
private static final SdkField MINIMUM_LINKS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("minimumLinks").getter(getter(Lag::minimumLinks)).setter(setter(Builder::minimumLinks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minimumLinks").build()).build();
private static final SdkField AWS_DEVICE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("awsDevice").getter(getter(Lag::awsDevice)).setter(setter(Builder::awsDevice))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awsDevice").build()).build();
private static final SdkField AWS_DEVICE_V2_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("awsDeviceV2").getter(getter(Lag::awsDeviceV2)).setter(setter(Builder::awsDeviceV2))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awsDeviceV2").build()).build();
private static final SdkField AWS_LOGICAL_DEVICE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("awsLogicalDeviceId").getter(getter(Lag::awsLogicalDeviceId)).setter(setter(Builder::awsLogicalDeviceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("awsLogicalDeviceId").build())
.build();
private static final SdkField> CONNECTIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("connections")
.getter(getter(Lag::connections))
.setter(setter(Builder::connections))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connections").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Connection::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ALLOWS_HOSTED_CONNECTIONS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("allowsHostedConnections").getter(getter(Lag::allowsHostedConnections))
.setter(setter(Builder::allowsHostedConnections))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("allowsHostedConnections").build())
.build();
private static final SdkField JUMBO_FRAME_CAPABLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("jumboFrameCapable").getter(getter(Lag::jumboFrameCapable)).setter(setter(Builder::jumboFrameCapable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jumboFrameCapable").build()).build();
private static final SdkField HAS_LOGICAL_REDUNDANCY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("hasLogicalRedundancy").getter(getter(Lag::hasLogicalRedundancyAsString))
.setter(setter(Builder::hasLogicalRedundancy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hasLogicalRedundancy").build())
.build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("tags")
.getter(getter(Lag::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField PROVIDER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("providerName").getter(getter(Lag::providerName)).setter(setter(Builder::providerName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("providerName").build()).build();
private static final SdkField MAC_SEC_CAPABLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("macSecCapable").getter(getter(Lag::macSecCapable)).setter(setter(Builder::macSecCapable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("macSecCapable").build()).build();
private static final SdkField ENCRYPTION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("encryptionMode").getter(getter(Lag::encryptionMode)).setter(setter(Builder::encryptionMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionMode").build()).build();
private static final SdkField> MAC_SEC_KEYS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("macSecKeys")
.getter(getter(Lag::macSecKeys))
.setter(setter(Builder::macSecKeys))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("macSecKeys").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MacSecKey::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONNECTIONS_BANDWIDTH_FIELD,
NUMBER_OF_CONNECTIONS_FIELD, LAG_ID_FIELD, OWNER_ACCOUNT_FIELD, LAG_NAME_FIELD, LAG_STATE_FIELD, LOCATION_FIELD,
REGION_FIELD, MINIMUM_LINKS_FIELD, AWS_DEVICE_FIELD, AWS_DEVICE_V2_FIELD, AWS_LOGICAL_DEVICE_ID_FIELD,
CONNECTIONS_FIELD, ALLOWS_HOSTED_CONNECTIONS_FIELD, JUMBO_FRAME_CAPABLE_FIELD, HAS_LOGICAL_REDUNDANCY_FIELD,
TAGS_FIELD, PROVIDER_NAME_FIELD, MAC_SEC_CAPABLE_FIELD, ENCRYPTION_MODE_FIELD, MAC_SEC_KEYS_FIELD));
private static final long serialVersionUID = 1L;
private final String connectionsBandwidth;
private final Integer numberOfConnections;
private final String lagId;
private final String ownerAccount;
private final String lagName;
private final String lagState;
private final String location;
private final String region;
private final Integer minimumLinks;
private final String awsDevice;
private final String awsDeviceV2;
private final String awsLogicalDeviceId;
private final List connections;
private final Boolean allowsHostedConnections;
private final Boolean jumboFrameCapable;
private final String hasLogicalRedundancy;
private final List tags;
private final String providerName;
private final Boolean macSecCapable;
private final String encryptionMode;
private final List macSecKeys;
private Lag(BuilderImpl builder) {
this.connectionsBandwidth = builder.connectionsBandwidth;
this.numberOfConnections = builder.numberOfConnections;
this.lagId = builder.lagId;
this.ownerAccount = builder.ownerAccount;
this.lagName = builder.lagName;
this.lagState = builder.lagState;
this.location = builder.location;
this.region = builder.region;
this.minimumLinks = builder.minimumLinks;
this.awsDevice = builder.awsDevice;
this.awsDeviceV2 = builder.awsDeviceV2;
this.awsLogicalDeviceId = builder.awsLogicalDeviceId;
this.connections = builder.connections;
this.allowsHostedConnections = builder.allowsHostedConnections;
this.jumboFrameCapable = builder.jumboFrameCapable;
this.hasLogicalRedundancy = builder.hasLogicalRedundancy;
this.tags = builder.tags;
this.providerName = builder.providerName;
this.macSecCapable = builder.macSecCapable;
this.encryptionMode = builder.encryptionMode;
this.macSecKeys = builder.macSecKeys;
}
/**
*
* The individual bandwidth of the physical connections bundled by the LAG. The possible values are 1Gbps and
* 10Gbps.
*
*
* @return The individual bandwidth of the physical connections bundled by the LAG. The possible values are 1Gbps
* and 10Gbps.
*/
public final String connectionsBandwidth() {
return connectionsBandwidth;
}
/**
*
* The number of physical dedicated connections bundled by the LAG, up to a maximum of 10.
*
*
* @return The number of physical dedicated connections bundled by the LAG, up to a maximum of 10.
*/
public final Integer numberOfConnections() {
return numberOfConnections;
}
/**
*
* The ID of the LAG.
*
*
* @return The ID of the LAG.
*/
public final String lagId() {
return lagId;
}
/**
*
* The ID of the Amazon Web Services account that owns the LAG.
*
*
* @return The ID of the Amazon Web Services account that owns the LAG.
*/
public final String ownerAccount() {
return ownerAccount;
}
/**
*
* The name of the LAG.
*
*
* @return The name of the LAG.
*/
public final String lagName() {
return lagName;
}
/**
*
* The state of the LAG. The following are the possible values:
*
*
* -
*
* requested
: The initial state of a LAG. The LAG stays in the requested state until the Letter of
* Authorization (LOA) is available.
*
*
* -
*
* pending
: The LAG has been approved and is being initialized.
*
*
* -
*
* available
: The network link is established and the LAG is ready for use.
*
*
* -
*
* down
: The network link is down.
*
*
* -
*
* deleting
: The LAG is being deleted.
*
*
* -
*
* deleted
: The LAG is deleted.
*
*
* -
*
* unknown
: The state of the LAG is not available.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #lagState} will
* return {@link LagState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #lagStateAsString}.
*
*
* @return The state of the LAG. The following are the possible values:
*
* -
*
* requested
: The initial state of a LAG. The LAG stays in the requested state until the Letter
* of Authorization (LOA) is available.
*
*
* -
*
* pending
: The LAG has been approved and is being initialized.
*
*
* -
*
* available
: The network link is established and the LAG is ready for use.
*
*
* -
*
* down
: The network link is down.
*
*
* -
*
* deleting
: The LAG is being deleted.
*
*
* -
*
* deleted
: The LAG is deleted.
*
*
* -
*
* unknown
: The state of the LAG is not available.
*
*
* @see LagState
*/
public final LagState lagState() {
return LagState.fromValue(lagState);
}
/**
*
* The state of the LAG. The following are the possible values:
*
*
* -
*
* requested
: The initial state of a LAG. The LAG stays in the requested state until the Letter of
* Authorization (LOA) is available.
*
*
* -
*
* pending
: The LAG has been approved and is being initialized.
*
*
* -
*
* available
: The network link is established and the LAG is ready for use.
*
*
* -
*
* down
: The network link is down.
*
*
* -
*
* deleting
: The LAG is being deleted.
*
*
* -
*
* deleted
: The LAG is deleted.
*
*
* -
*
* unknown
: The state of the LAG is not available.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #lagState} will
* return {@link LagState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #lagStateAsString}.
*
*
* @return The state of the LAG. The following are the possible values:
*
* -
*
* requested
: The initial state of a LAG. The LAG stays in the requested state until the Letter
* of Authorization (LOA) is available.
*
*
* -
*
* pending
: The LAG has been approved and is being initialized.
*
*
* -
*
* available
: The network link is established and the LAG is ready for use.
*
*
* -
*
* down
: The network link is down.
*
*
* -
*
* deleting
: The LAG is being deleted.
*
*
* -
*
* deleted
: The LAG is deleted.
*
*
* -
*
* unknown
: The state of the LAG is not available.
*
*
* @see LagState
*/
public final String lagStateAsString() {
return lagState;
}
/**
*
* The location of the LAG.
*
*
* @return The location of the LAG.
*/
public final String location() {
return location;
}
/**
*
* The Amazon Web Services Region where the connection is located.
*
*
* @return The Amazon Web Services Region where the connection is located.
*/
public final String region() {
return region;
}
/**
*
* The minimum number of physical dedicated connections that must be operational for the LAG itself to be
* operational.
*
*
* @return The minimum number of physical dedicated connections that must be operational for the LAG itself to be
* operational.
*/
public final Integer minimumLinks() {
return minimumLinks;
}
/**
*
* The Direct Connect endpoint that hosts the LAG.
*
*
* @return The Direct Connect endpoint that hosts the LAG.
*/
public final String awsDevice() {
return awsDevice;
}
/**
*
* The Direct Connect endpoint that hosts the LAG.
*
*
* @return The Direct Connect endpoint that hosts the LAG.
*/
public final String awsDeviceV2() {
return awsDeviceV2;
}
/**
*
* The Direct Connect endpoint that terminates the logical connection. This device might be different than the
* device that terminates the physical connection.
*
*
* @return The Direct Connect endpoint that terminates the logical connection. This device might be different than
* the device that terminates the physical connection.
*/
public final String awsLogicalDeviceId() {
return awsLogicalDeviceId;
}
/**
* For responses, this returns true if the service returned a value for the Connections 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 hasConnections() {
return connections != null && !(connections instanceof SdkAutoConstructList);
}
/**
*
* The connections bundled by the LAG.
*
*
* 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 #hasConnections} method.
*
*
* @return The connections bundled by the LAG.
*/
public final List connections() {
return connections;
}
/**
*
* Indicates whether the LAG can host other connections.
*
*
* @return Indicates whether the LAG can host other connections.
*/
public final Boolean allowsHostedConnections() {
return allowsHostedConnections;
}
/**
*
* Indicates whether jumbo frames are supported.
*
*
* @return Indicates whether jumbo frames are supported.
*/
public final Boolean jumboFrameCapable() {
return jumboFrameCapable;
}
/**
*
* Indicates whether the LAG supports a secondary BGP peer in the same address family (IPv4/IPv6).
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #hasLogicalRedundancy} will return {@link HasLogicalRedundancy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #hasLogicalRedundancyAsString}.
*
*
* @return Indicates whether the LAG supports a secondary BGP peer in the same address family (IPv4/IPv6).
* @see HasLogicalRedundancy
*/
public final HasLogicalRedundancy hasLogicalRedundancy() {
return HasLogicalRedundancy.fromValue(hasLogicalRedundancy);
}
/**
*
* Indicates whether the LAG supports a secondary BGP peer in the same address family (IPv4/IPv6).
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #hasLogicalRedundancy} will return {@link HasLogicalRedundancy#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #hasLogicalRedundancyAsString}.
*
*
* @return Indicates whether the LAG supports a secondary BGP peer in the same address family (IPv4/IPv6).
* @see HasLogicalRedundancy
*/
public final String hasLogicalRedundancyAsString() {
return hasLogicalRedundancy;
}
/**
* 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 associated with the LAG.
*
*
* 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 associated with the LAG.
*/
public final List tags() {
return tags;
}
/**
*
* The name of the service provider associated with the LAG.
*
*
* @return The name of the service provider associated with the LAG.
*/
public final String providerName() {
return providerName;
}
/**
*
* Indicates whether the LAG supports MAC Security (MACsec).
*
*
* @return Indicates whether the LAG supports MAC Security (MACsec).
*/
public final Boolean macSecCapable() {
return macSecCapable;
}
/**
*
* The LAG MAC Security (MACsec) encryption mode.
*
*
* The valid values are no_encrypt
, should_encrypt
, and must_encrypt
.
*
*
* @return The LAG MAC Security (MACsec) encryption mode.
*
* The valid values are no_encrypt
, should_encrypt
, and must_encrypt
.
*/
public final String encryptionMode() {
return encryptionMode;
}
/**
* For responses, this returns true if the service returned a value for the MacSecKeys 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 hasMacSecKeys() {
return macSecKeys != null && !(macSecKeys instanceof SdkAutoConstructList);
}
/**
*
* The MAC Security (MACsec) security keys associated with the LAG.
*
*
* 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 #hasMacSecKeys} method.
*
*
* @return The MAC Security (MACsec) security keys associated with the LAG.
*/
public final List macSecKeys() {
return macSecKeys;
}
@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(connectionsBandwidth());
hashCode = 31 * hashCode + Objects.hashCode(numberOfConnections());
hashCode = 31 * hashCode + Objects.hashCode(lagId());
hashCode = 31 * hashCode + Objects.hashCode(ownerAccount());
hashCode = 31 * hashCode + Objects.hashCode(lagName());
hashCode = 31 * hashCode + Objects.hashCode(lagStateAsString());
hashCode = 31 * hashCode + Objects.hashCode(location());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(minimumLinks());
hashCode = 31 * hashCode + Objects.hashCode(awsDevice());
hashCode = 31 * hashCode + Objects.hashCode(awsDeviceV2());
hashCode = 31 * hashCode + Objects.hashCode(awsLogicalDeviceId());
hashCode = 31 * hashCode + Objects.hashCode(hasConnections() ? connections() : null);
hashCode = 31 * hashCode + Objects.hashCode(allowsHostedConnections());
hashCode = 31 * hashCode + Objects.hashCode(jumboFrameCapable());
hashCode = 31 * hashCode + Objects.hashCode(hasLogicalRedundancyAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(providerName());
hashCode = 31 * hashCode + Objects.hashCode(macSecCapable());
hashCode = 31 * hashCode + Objects.hashCode(encryptionMode());
hashCode = 31 * hashCode + Objects.hashCode(hasMacSecKeys() ? macSecKeys() : 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 Lag)) {
return false;
}
Lag other = (Lag) obj;
return Objects.equals(connectionsBandwidth(), other.connectionsBandwidth())
&& Objects.equals(numberOfConnections(), other.numberOfConnections()) && Objects.equals(lagId(), other.lagId())
&& Objects.equals(ownerAccount(), other.ownerAccount()) && Objects.equals(lagName(), other.lagName())
&& Objects.equals(lagStateAsString(), other.lagStateAsString()) && Objects.equals(location(), other.location())
&& Objects.equals(region(), other.region()) && Objects.equals(minimumLinks(), other.minimumLinks())
&& Objects.equals(awsDevice(), other.awsDevice()) && Objects.equals(awsDeviceV2(), other.awsDeviceV2())
&& Objects.equals(awsLogicalDeviceId(), other.awsLogicalDeviceId()) && hasConnections() == other.hasConnections()
&& Objects.equals(connections(), other.connections())
&& Objects.equals(allowsHostedConnections(), other.allowsHostedConnections())
&& Objects.equals(jumboFrameCapable(), other.jumboFrameCapable())
&& Objects.equals(hasLogicalRedundancyAsString(), other.hasLogicalRedundancyAsString())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags())
&& Objects.equals(providerName(), other.providerName()) && Objects.equals(macSecCapable(), other.macSecCapable())
&& Objects.equals(encryptionMode(), other.encryptionMode()) && hasMacSecKeys() == other.hasMacSecKeys()
&& Objects.equals(macSecKeys(), other.macSecKeys());
}
/**
* 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("Lag").add("ConnectionsBandwidth", connectionsBandwidth())
.add("NumberOfConnections", numberOfConnections()).add("LagId", lagId()).add("OwnerAccount", ownerAccount())
.add("LagName", lagName()).add("LagState", lagStateAsString()).add("Location", location())
.add("Region", region()).add("MinimumLinks", minimumLinks()).add("AwsDevice", awsDevice())
.add("AwsDeviceV2", awsDeviceV2()).add("AwsLogicalDeviceId", awsLogicalDeviceId())
.add("Connections", hasConnections() ? connections() : null)
.add("AllowsHostedConnections", allowsHostedConnections()).add("JumboFrameCapable", jumboFrameCapable())
.add("HasLogicalRedundancy", hasLogicalRedundancyAsString()).add("Tags", hasTags() ? tags() : null)
.add("ProviderName", providerName()).add("MacSecCapable", macSecCapable())
.add("EncryptionMode", encryptionMode()).add("MacSecKeys", hasMacSecKeys() ? macSecKeys() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "connectionsBandwidth":
return Optional.ofNullable(clazz.cast(connectionsBandwidth()));
case "numberOfConnections":
return Optional.ofNullable(clazz.cast(numberOfConnections()));
case "lagId":
return Optional.ofNullable(clazz.cast(lagId()));
case "ownerAccount":
return Optional.ofNullable(clazz.cast(ownerAccount()));
case "lagName":
return Optional.ofNullable(clazz.cast(lagName()));
case "lagState":
return Optional.ofNullable(clazz.cast(lagStateAsString()));
case "location":
return Optional.ofNullable(clazz.cast(location()));
case "region":
return Optional.ofNullable(clazz.cast(region()));
case "minimumLinks":
return Optional.ofNullable(clazz.cast(minimumLinks()));
case "awsDevice":
return Optional.ofNullable(clazz.cast(awsDevice()));
case "awsDeviceV2":
return Optional.ofNullable(clazz.cast(awsDeviceV2()));
case "awsLogicalDeviceId":
return Optional.ofNullable(clazz.cast(awsLogicalDeviceId()));
case "connections":
return Optional.ofNullable(clazz.cast(connections()));
case "allowsHostedConnections":
return Optional.ofNullable(clazz.cast(allowsHostedConnections()));
case "jumboFrameCapable":
return Optional.ofNullable(clazz.cast(jumboFrameCapable()));
case "hasLogicalRedundancy":
return Optional.ofNullable(clazz.cast(hasLogicalRedundancyAsString()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
case "providerName":
return Optional.ofNullable(clazz.cast(providerName()));
case "macSecCapable":
return Optional.ofNullable(clazz.cast(macSecCapable()));
case "encryptionMode":
return Optional.ofNullable(clazz.cast(encryptionMode()));
case "macSecKeys":
return Optional.ofNullable(clazz.cast(macSecKeys()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function