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

software.amazon.awssdk.services.backupgateway.model.Hypervisor Maven / Gradle / Ivy

/*
 * 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.backupgateway.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;

/**
 * 

* Represents the hypervisor's permissions to which the gateway will connect. *

*

* A hypervisor is hardware, software, or firmware that creates and manages virtual machines, and allocates resources to * them. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Hypervisor implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField HOST_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Host") .getter(getter(Hypervisor::host)).setter(setter(Builder::host)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Host").build()).build(); private static final SdkField HYPERVISOR_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("HypervisorArn").getter(getter(Hypervisor::hypervisorArn)).setter(setter(Builder::hypervisorArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HypervisorArn").build()).build(); private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("KmsKeyArn").getter(getter(Hypervisor::kmsKeyArn)).setter(setter(Builder::kmsKeyArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyArn").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(Hypervisor::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State") .getter(getter(Hypervisor::stateAsString)).setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(HOST_FIELD, HYPERVISOR_ARN_FIELD, KMS_KEY_ARN_FIELD, NAME_FIELD, STATE_FIELD)); private static final long serialVersionUID = 1L; private final String host; private final String hypervisorArn; private final String kmsKeyArn; private final String name; private final String state; private Hypervisor(BuilderImpl builder) { this.host = builder.host; this.hypervisorArn = builder.hypervisorArn; this.kmsKeyArn = builder.kmsKeyArn; this.name = builder.name; this.state = builder.state; } /** *

* The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN). *

* * @return The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name * (FQDN). */ public final String host() { return host; } /** *

* The Amazon Resource Name (ARN) of the hypervisor. *

* * @return The Amazon Resource Name (ARN) of the hypervisor. */ public final String hypervisorArn() { return hypervisorArn; } /** *

* The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor. *

* * @return The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor. */ public final String kmsKeyArn() { return kmsKeyArn; } /** *

* The name of the hypervisor. *

* * @return The name of the hypervisor. */ public final String name() { return name; } /** *

* The state of the hypervisor. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link HypervisorState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The state of the hypervisor. * @see HypervisorState */ public final HypervisorState state() { return HypervisorState.fromValue(state); } /** *

* The state of the hypervisor. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link HypervisorState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The state of the hypervisor. * @see HypervisorState */ public final String stateAsString() { return state; } @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(host()); hashCode = 31 * hashCode + Objects.hashCode(hypervisorArn()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); 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 Hypervisor)) { return false; } Hypervisor other = (Hypervisor) obj; return Objects.equals(host(), other.host()) && Objects.equals(hypervisorArn(), other.hypervisorArn()) && Objects.equals(kmsKeyArn(), other.kmsKeyArn()) && Objects.equals(name(), other.name()) && Objects.equals(stateAsString(), other.stateAsString()); } /** * 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("Hypervisor").add("Host", host()).add("HypervisorArn", hypervisorArn()) .add("KmsKeyArn", kmsKeyArn()).add("Name", name()).add("State", stateAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Host": return Optional.ofNullable(clazz.cast(host())); case "HypervisorArn": return Optional.ofNullable(clazz.cast(hypervisorArn())); case "KmsKeyArn": return Optional.ofNullable(clazz.cast(kmsKeyArn())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Hypervisor) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN). *

* * @param host * The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name * (FQDN). * @return Returns a reference to this object so that method calls can be chained together. */ Builder host(String host); /** *

* The Amazon Resource Name (ARN) of the hypervisor. *

* * @param hypervisorArn * The Amazon Resource Name (ARN) of the hypervisor. * @return Returns a reference to this object so that method calls can be chained together. */ Builder hypervisorArn(String hypervisorArn); /** *

* The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor. *

* * @param kmsKeyArn * The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyArn(String kmsKeyArn); /** *

* The name of the hypervisor. *

* * @param name * The name of the hypervisor. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The state of the hypervisor. *

* * @param state * The state of the hypervisor. * @see HypervisorState * @return Returns a reference to this object so that method calls can be chained together. * @see HypervisorState */ Builder state(String state); /** *

* The state of the hypervisor. *

* * @param state * The state of the hypervisor. * @see HypervisorState * @return Returns a reference to this object so that method calls can be chained together. * @see HypervisorState */ Builder state(HypervisorState state); } static final class BuilderImpl implements Builder { private String host; private String hypervisorArn; private String kmsKeyArn; private String name; private String state; private BuilderImpl() { } private BuilderImpl(Hypervisor model) { host(model.host); hypervisorArn(model.hypervisorArn); kmsKeyArn(model.kmsKeyArn); name(model.name); state(model.state); } public final String getHost() { return host; } public final void setHost(String host) { this.host = host; } @Override public final Builder host(String host) { this.host = host; return this; } public final String getHypervisorArn() { return hypervisorArn; } public final void setHypervisorArn(String hypervisorArn) { this.hypervisorArn = hypervisorArn; } @Override public final Builder hypervisorArn(String hypervisorArn) { this.hypervisorArn = hypervisorArn; return this; } public final String getKmsKeyArn() { return kmsKeyArn; } public final void setKmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; } @Override public final Builder kmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(HypervisorState state) { this.state(state == null ? null : state.toString()); return this; } @Override public Hypervisor build() { return new Hypervisor(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy