
software.amazon.awssdk.services.sms.model.VmServerAddress Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of servermigration Show documentation
Show all versions of servermigration Show documentation
The AWS Java SDK for AWS Server Migration module holds the client classes that are used for
communicating with AWS Server Migration Service
The newest version!
/*
* 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 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.VmServerAddressMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Object representing a server's location
*/
@Generated("software.amazon.awssdk:codegen")
public final class VmServerAddress implements StructuredPojo, ToCopyableBuilder {
private final String vmManagerId;
private final String vmId;
private VmServerAddress(BuilderImpl builder) {
this.vmManagerId = builder.vmManagerId;
this.vmId = builder.vmId;
}
/**
* Returns the value of the VmManagerId property for this object.
*
* @return The value of the VmManagerId property for this object.
*/
public String vmManagerId() {
return vmManagerId;
}
/**
* Returns the value of the VmId property for this object.
*
* @return The value of the VmId property for this object.
*/
public String vmId() {
return vmId;
}
@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(vmManagerId());
hashCode = 31 * hashCode + Objects.hashCode(vmId());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VmServerAddress)) {
return false;
}
VmServerAddress other = (VmServerAddress) obj;
return Objects.equals(vmManagerId(), other.vmManagerId()) && Objects.equals(vmId(), other.vmId());
}
@Override
public String toString() {
return ToString.builder("VmServerAddress").add("VmManagerId", vmManagerId()).add("VmId", vmId()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "vmManagerId":
return Optional.ofNullable(clazz.cast(vmManagerId()));
case "vmId":
return Optional.ofNullable(clazz.cast(vmId()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
VmServerAddressMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
* Sets the value of the VmManagerId property for this object.
*
* @param vmManagerId
* The new value for the VmManagerId property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmManagerId(String vmManagerId);
/**
* Sets the value of the VmId property for this object.
*
* @param vmId
* The new value for the VmId property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vmId(String vmId);
}
static final class BuilderImpl implements Builder {
private String vmManagerId;
private String vmId;
private BuilderImpl() {
}
private BuilderImpl(VmServerAddress model) {
vmManagerId(model.vmManagerId);
vmId(model.vmId);
}
public final String getVmManagerId() {
return vmManagerId;
}
@Override
public final Builder vmManagerId(String vmManagerId) {
this.vmManagerId = vmManagerId;
return this;
}
public final void setVmManagerId(String vmManagerId) {
this.vmManagerId = vmManagerId;
}
public final String getVmId() {
return vmId;
}
@Override
public final Builder vmId(String vmId) {
this.vmId = vmId;
return this;
}
public final void setVmId(String vmId) {
this.vmId = vmId;
}
@Override
public VmServerAddress build() {
return new VmServerAddress(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy