software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface Maven / Gradle / Ivy
Show all versions of snowdevicemanagement 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.snowdevicemanagement.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;
/**
*
* The details about the physical network interface for the device.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PhysicalNetworkInterface implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DEFAULT_GATEWAY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("defaultGateway").getter(getter(PhysicalNetworkInterface::defaultGateway))
.setter(setter(Builder::defaultGateway))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("defaultGateway").build()).build();
private static final SdkField IP_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ipAddress").getter(getter(PhysicalNetworkInterface::ipAddress)).setter(setter(Builder::ipAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ipAddress").build()).build();
private static final SdkField IP_ADDRESS_ASSIGNMENT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ipAddressAssignment").getter(getter(PhysicalNetworkInterface::ipAddressAssignmentAsString))
.setter(setter(Builder::ipAddressAssignment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ipAddressAssignment").build())
.build();
private static final SdkField MAC_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("macAddress").getter(getter(PhysicalNetworkInterface::macAddress)).setter(setter(Builder::macAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("macAddress").build()).build();
private static final SdkField NETMASK_FIELD = SdkField. builder(MarshallingType.STRING).memberName("netmask")
.getter(getter(PhysicalNetworkInterface::netmask)).setter(setter(Builder::netmask))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("netmask").build()).build();
private static final SdkField PHYSICAL_CONNECTOR_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("physicalConnectorType").getter(getter(PhysicalNetworkInterface::physicalConnectorTypeAsString))
.setter(setter(Builder::physicalConnectorType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("physicalConnectorType").build())
.build();
private static final SdkField PHYSICAL_NETWORK_INTERFACE_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("physicalNetworkInterfaceId")
.getter(getter(PhysicalNetworkInterface::physicalNetworkInterfaceId))
.setter(setter(Builder::physicalNetworkInterfaceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("physicalNetworkInterfaceId").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DEFAULT_GATEWAY_FIELD,
IP_ADDRESS_FIELD, IP_ADDRESS_ASSIGNMENT_FIELD, MAC_ADDRESS_FIELD, NETMASK_FIELD, PHYSICAL_CONNECTOR_TYPE_FIELD,
PHYSICAL_NETWORK_INTERFACE_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String defaultGateway;
private final String ipAddress;
private final String ipAddressAssignment;
private final String macAddress;
private final String netmask;
private final String physicalConnectorType;
private final String physicalNetworkInterfaceId;
private PhysicalNetworkInterface(BuilderImpl builder) {
this.defaultGateway = builder.defaultGateway;
this.ipAddress = builder.ipAddress;
this.ipAddressAssignment = builder.ipAddressAssignment;
this.macAddress = builder.macAddress;
this.netmask = builder.netmask;
this.physicalConnectorType = builder.physicalConnectorType;
this.physicalNetworkInterfaceId = builder.physicalNetworkInterfaceId;
}
/**
*
* The default gateway of the device.
*
*
* @return The default gateway of the device.
*/
public final String defaultGateway() {
return defaultGateway;
}
/**
*
* The IP address of the device.
*
*
* @return The IP address of the device.
*/
public final String ipAddress() {
return ipAddress;
}
/**
*
* A value that describes whether the IP address is dynamic or persistent.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #ipAddressAssignment} will return {@link IpAddressAssignment#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #ipAddressAssignmentAsString}.
*
*
* @return A value that describes whether the IP address is dynamic or persistent.
* @see IpAddressAssignment
*/
public final IpAddressAssignment ipAddressAssignment() {
return IpAddressAssignment.fromValue(ipAddressAssignment);
}
/**
*
* A value that describes whether the IP address is dynamic or persistent.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #ipAddressAssignment} will return {@link IpAddressAssignment#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #ipAddressAssignmentAsString}.
*
*
* @return A value that describes whether the IP address is dynamic or persistent.
* @see IpAddressAssignment
*/
public final String ipAddressAssignmentAsString() {
return ipAddressAssignment;
}
/**
*
* The MAC address of the device.
*
*
* @return The MAC address of the device.
*/
public final String macAddress() {
return macAddress;
}
/**
*
* The netmask used to divide the IP address into subnets.
*
*
* @return The netmask used to divide the IP address into subnets.
*/
public final String netmask() {
return netmask;
}
/**
*
* The physical connector type.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #physicalConnectorType} will return {@link PhysicalConnectorType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #physicalConnectorTypeAsString}.
*
*
* @return The physical connector type.
* @see PhysicalConnectorType
*/
public final PhysicalConnectorType physicalConnectorType() {
return PhysicalConnectorType.fromValue(physicalConnectorType);
}
/**
*
* The physical connector type.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #physicalConnectorType} will return {@link PhysicalConnectorType#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #physicalConnectorTypeAsString}.
*
*
* @return The physical connector type.
* @see PhysicalConnectorType
*/
public final String physicalConnectorTypeAsString() {
return physicalConnectorType;
}
/**
*
* The physical network interface ID.
*
*
* @return The physical network interface ID.
*/
public final String physicalNetworkInterfaceId() {
return physicalNetworkInterfaceId;
}
@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(defaultGateway());
hashCode = 31 * hashCode + Objects.hashCode(ipAddress());
hashCode = 31 * hashCode + Objects.hashCode(ipAddressAssignmentAsString());
hashCode = 31 * hashCode + Objects.hashCode(macAddress());
hashCode = 31 * hashCode + Objects.hashCode(netmask());
hashCode = 31 * hashCode + Objects.hashCode(physicalConnectorTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(physicalNetworkInterfaceId());
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 PhysicalNetworkInterface)) {
return false;
}
PhysicalNetworkInterface other = (PhysicalNetworkInterface) obj;
return Objects.equals(defaultGateway(), other.defaultGateway()) && Objects.equals(ipAddress(), other.ipAddress())
&& Objects.equals(ipAddressAssignmentAsString(), other.ipAddressAssignmentAsString())
&& Objects.equals(macAddress(), other.macAddress()) && Objects.equals(netmask(), other.netmask())
&& Objects.equals(physicalConnectorTypeAsString(), other.physicalConnectorTypeAsString())
&& Objects.equals(physicalNetworkInterfaceId(), other.physicalNetworkInterfaceId());
}
/**
* 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("PhysicalNetworkInterface").add("DefaultGateway", defaultGateway()).add("IpAddress", ipAddress())
.add("IpAddressAssignment", ipAddressAssignmentAsString()).add("MacAddress", macAddress())
.add("Netmask", netmask()).add("PhysicalConnectorType", physicalConnectorTypeAsString())
.add("PhysicalNetworkInterfaceId", physicalNetworkInterfaceId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "defaultGateway":
return Optional.ofNullable(clazz.cast(defaultGateway()));
case "ipAddress":
return Optional.ofNullable(clazz.cast(ipAddress()));
case "ipAddressAssignment":
return Optional.ofNullable(clazz.cast(ipAddressAssignmentAsString()));
case "macAddress":
return Optional.ofNullable(clazz.cast(macAddress()));
case "netmask":
return Optional.ofNullable(clazz.cast(netmask()));
case "physicalConnectorType":
return Optional.ofNullable(clazz.cast(physicalConnectorTypeAsString()));
case "physicalNetworkInterfaceId":
return Optional.ofNullable(clazz.cast(physicalNetworkInterfaceId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function