software.amazon.awssdk.services.elasticinference.model.ElasticInferenceAccelerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticinference Show documentation
Show all versions of elasticinference Show documentation
The AWS Java SDK for Elastic Inference module holds the client classes that are used for
communicating with Elastic Inference.
/*
* 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.elasticinference.model;
import java.io.Serializable;
import java.util.Arrays;
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 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 of an Elastic Inference Accelerator.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ElasticInferenceAccelerator implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCELERATOR_HEALTH_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("acceleratorHealth")
.getter(getter(ElasticInferenceAccelerator::acceleratorHealth)).setter(setter(Builder::acceleratorHealth))
.constructor(ElasticInferenceAcceleratorHealth::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("acceleratorHealth").build()).build();
private static final SdkField ACCELERATOR_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("acceleratorType").getter(getter(ElasticInferenceAccelerator::acceleratorType))
.setter(setter(Builder::acceleratorType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("acceleratorType").build()).build();
private static final SdkField ACCELERATOR_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("acceleratorId").getter(getter(ElasticInferenceAccelerator::acceleratorId))
.setter(setter(Builder::acceleratorId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("acceleratorId").build()).build();
private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("availabilityZone").getter(getter(ElasticInferenceAccelerator::availabilityZone))
.setter(setter(Builder::availabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("availabilityZone").build()).build();
private static final SdkField ATTACHED_RESOURCE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("attachedResource").getter(getter(ElasticInferenceAccelerator::attachedResource))
.setter(setter(Builder::attachedResource))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("attachedResource").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCELERATOR_HEALTH_FIELD,
ACCELERATOR_TYPE_FIELD, ACCELERATOR_ID_FIELD, AVAILABILITY_ZONE_FIELD, ATTACHED_RESOURCE_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final ElasticInferenceAcceleratorHealth acceleratorHealth;
private final String acceleratorType;
private final String acceleratorId;
private final String availabilityZone;
private final String attachedResource;
private ElasticInferenceAccelerator(BuilderImpl builder) {
this.acceleratorHealth = builder.acceleratorHealth;
this.acceleratorType = builder.acceleratorType;
this.acceleratorId = builder.acceleratorId;
this.availabilityZone = builder.availabilityZone;
this.attachedResource = builder.attachedResource;
}
/**
*
* The health of the Elastic Inference Accelerator.
*
*
* @return The health of the Elastic Inference Accelerator.
*/
public final ElasticInferenceAcceleratorHealth acceleratorHealth() {
return acceleratorHealth;
}
/**
*
* The type of the Elastic Inference Accelerator.
*
*
* @return The type of the Elastic Inference Accelerator.
*/
public final String acceleratorType() {
return acceleratorType;
}
/**
*
* The ID of the Elastic Inference Accelerator.
*
*
* @return The ID of the Elastic Inference Accelerator.
*/
public final String acceleratorId() {
return acceleratorId;
}
/**
*
* The availability zone where the Elastic Inference Accelerator is present.
*
*
* @return The availability zone where the Elastic Inference Accelerator is present.
*/
public final String availabilityZone() {
return availabilityZone;
}
/**
*
* The ARN of the resource that the Elastic Inference Accelerator is attached to.
*
*
* @return The ARN of the resource that the Elastic Inference Accelerator is attached to.
*/
public final String attachedResource() {
return attachedResource;
}
@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(acceleratorHealth());
hashCode = 31 * hashCode + Objects.hashCode(acceleratorType());
hashCode = 31 * hashCode + Objects.hashCode(acceleratorId());
hashCode = 31 * hashCode + Objects.hashCode(availabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(attachedResource());
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 ElasticInferenceAccelerator)) {
return false;
}
ElasticInferenceAccelerator other = (ElasticInferenceAccelerator) obj;
return Objects.equals(acceleratorHealth(), other.acceleratorHealth())
&& Objects.equals(acceleratorType(), other.acceleratorType())
&& Objects.equals(acceleratorId(), other.acceleratorId())
&& Objects.equals(availabilityZone(), other.availabilityZone())
&& Objects.equals(attachedResource(), other.attachedResource());
}
/**
* 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("ElasticInferenceAccelerator").add("AcceleratorHealth", acceleratorHealth())
.add("AcceleratorType", acceleratorType()).add("AcceleratorId", acceleratorId())
.add("AvailabilityZone", availabilityZone()).add("AttachedResource", attachedResource()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "acceleratorHealth":
return Optional.ofNullable(clazz.cast(acceleratorHealth()));
case "acceleratorType":
return Optional.ofNullable(clazz.cast(acceleratorType()));
case "acceleratorId":
return Optional.ofNullable(clazz.cast(acceleratorId()));
case "availabilityZone":
return Optional.ofNullable(clazz.cast(availabilityZone()));
case "attachedResource":
return Optional.ofNullable(clazz.cast(attachedResource()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("acceleratorHealth", ACCELERATOR_HEALTH_FIELD);
map.put("acceleratorType", ACCELERATOR_TYPE_FIELD);
map.put("acceleratorId", ACCELERATOR_ID_FIELD);
map.put("availabilityZone", AVAILABILITY_ZONE_FIELD);
map.put("attachedResource", ATTACHED_RESOURCE_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy