
software.amazon.awssdk.services.sms.model.VmServer Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.sms.model;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.sms.transform.VmServerMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Object representing a VM server
*/
@Generated("software.amazon.awssdk:codegen")
public final class VmServer implements StructuredPojo, ToCopyableBuilder {
private final VmServerAddress vmServerAddress;
private final String vmName;
private final String vmManagerName;
private final String vmManagerType;
private final String vmPath;
private VmServer(BuilderImpl builder) {
this.vmServerAddress = builder.vmServerAddress;
this.vmName = builder.vmName;
this.vmManagerName = builder.vmManagerName;
this.vmManagerType = builder.vmManagerType;
this.vmPath = builder.vmPath;
}
/**
* Returns the value of the VmServerAddress property for this object.
*
* @return The value of the VmServerAddress property for this object.
*/
public VmServerAddress vmServerAddress() {
return vmServerAddress;
}
/**
* Returns the value of the VmName property for this object.
*
* @return The value of the VmName property for this object.
*/
public String vmName() {
return vmName;
}
/**
* Returns the value of the VmManagerName property for this object.
*
* @return The value of the VmManagerName property for this object.
*/
public String vmManagerName() {
return vmManagerName;
}
/**
* Returns the value of the VmManagerType property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #vmManagerType}
* will return {@link VmManagerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #vmManagerTypeAsString}.
*
*
* @return The value of the VmManagerType property for this object.
* @see VmManagerType
*/
public VmManagerType vmManagerType() {
return VmManagerType.fromValue(vmManagerType);
}
/**
* Returns the value of the VmManagerType property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #vmManagerType}
* will return {@link VmManagerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #vmManagerTypeAsString}.
*
*
* @return The value of the VmManagerType property for this object.
* @see VmManagerType
*/
public String vmManagerTypeAsString() {
return vmManagerType;
}
/**
* Returns the value of the VmPath property for this object.
*
* @return The value of the VmPath property for this object.
*/
public String vmPath() {
return vmPath;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(vmServerAddress());
hashCode = 31 * hashCode + Objects.hashCode(vmName());
hashCode = 31 * hashCode + Objects.hashCode(vmManagerName());
hashCode = 31 * hashCode + Objects.hashCode(vmManagerTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(vmPath());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VmServer)) {
return false;
}
VmServer other = (VmServer) obj;
return Objects.equals(vmServerAddress(), other.vmServerAddress()) && Objects.equals(vmName(), other.vmName())
&& Objects.equals(vmManagerName(), other.vmManagerName())
&& Objects.equals(vmManagerTypeAsString(), other.vmManagerTypeAsString())
&& Objects.equals(vmPath(), other.vmPath());
}
@Override
public String toString() {
return ToString.builder("VmServer").add("VmServerAddress", vmServerAddress()).add("VmName", vmName())
.add("VmManagerName", vmManagerName()).add("VmManagerType", vmManagerTypeAsString()).add("VmPath", vmPath())
.build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "vmServerAddress":
return Optional.ofNullable(clazz.cast(vmServerAddress()));
case "vmName":
return Optional.ofNullable(clazz.cast(vmName()));
case "vmManagerName":
return Optional.ofNullable(clazz.cast(vmManagerName()));
case "vmManagerType":
return Optional.ofNullable(clazz.cast(vmManagerTypeAsString()));
case "vmPath":
return Optional.ofNullable(clazz.cast(vmPath()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
VmServerMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
* Sets the value of the VmServerAddress property for this object.
*
* @param vmServerAddress
* The new value for the VmServerAddress property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmServerAddress(VmServerAddress vmServerAddress);
/**
* Sets the value of the VmServerAddress property for this object.
*
* This is a convenience that creates an instance of the {@link VmServerAddress.Builder} avoiding the need to
* create one manually via {@link VmServerAddress#builder()}.
*
* When the {@link Consumer} completes, {@link VmServerAddress.Builder#build()} is called immediately and its
* result is passed to {@link #vmServerAddress(VmServerAddress)}.
*
* @param vmServerAddress
* a consumer that will call methods on {@link VmServerAddress.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #vmServerAddress(VmServerAddress)
*/
default Builder vmServerAddress(Consumer vmServerAddress) {
return vmServerAddress(VmServerAddress.builder().applyMutation(vmServerAddress).build());
}
/**
* Sets the value of the VmName property for this object.
*
* @param vmName
* The new value for the VmName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmName(String vmName);
/**
* Sets the value of the VmManagerName property for this object.
*
* @param vmManagerName
* The new value for the VmManagerName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmManagerName(String vmManagerName);
/**
* Sets the value of the VmManagerType property for this object.
*
* @param vmManagerType
* The new value for the VmManagerType property for this object.
* @see VmManagerType
* @return Returns a reference to this object so that method calls can be chained together.
* @see VmManagerType
*/
Builder vmManagerType(String vmManagerType);
/**
* Sets the value of the VmManagerType property for this object.
*
* @param vmManagerType
* The new value for the VmManagerType property for this object.
* @see VmManagerType
* @return Returns a reference to this object so that method calls can be chained together.
* @see VmManagerType
*/
Builder vmManagerType(VmManagerType vmManagerType);
/**
* Sets the value of the VmPath property for this object.
*
* @param vmPath
* The new value for the VmPath property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmPath(String vmPath);
}
static final class BuilderImpl implements Builder {
private VmServerAddress vmServerAddress;
private String vmName;
private String vmManagerName;
private String vmManagerType;
private String vmPath;
private BuilderImpl() {
}
private BuilderImpl(VmServer model) {
vmServerAddress(model.vmServerAddress);
vmName(model.vmName);
vmManagerName(model.vmManagerName);
vmManagerType(model.vmManagerType);
vmPath(model.vmPath);
}
public final VmServerAddress.Builder getVmServerAddress() {
return vmServerAddress != null ? vmServerAddress.toBuilder() : null;
}
@Override
public final Builder vmServerAddress(VmServerAddress vmServerAddress) {
this.vmServerAddress = vmServerAddress;
return this;
}
public final void setVmServerAddress(VmServerAddress.BuilderImpl vmServerAddress) {
this.vmServerAddress = vmServerAddress != null ? vmServerAddress.build() : null;
}
public final String getVmName() {
return vmName;
}
@Override
public final Builder vmName(String vmName) {
this.vmName = vmName;
return this;
}
public final void setVmName(String vmName) {
this.vmName = vmName;
}
public final String getVmManagerName() {
return vmManagerName;
}
@Override
public final Builder vmManagerName(String vmManagerName) {
this.vmManagerName = vmManagerName;
return this;
}
public final void setVmManagerName(String vmManagerName) {
this.vmManagerName = vmManagerName;
}
public final String getVmManagerType() {
return vmManagerType;
}
@Override
public final Builder vmManagerType(String vmManagerType) {
this.vmManagerType = vmManagerType;
return this;
}
@Override
public final Builder vmManagerType(VmManagerType vmManagerType) {
this.vmManagerType(vmManagerType.toString());
return this;
}
public final void setVmManagerType(String vmManagerType) {
this.vmManagerType = vmManagerType;
}
public final String getVmPath() {
return vmPath;
}
@Override
public final Builder vmPath(String vmPath) {
this.vmPath = vmPath;
return this;
}
public final void setVmPath(String vmPath) {
this.vmPath = vmPath;
}
@Override
public VmServer build() {
return new VmServer(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy