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

software.amazon.awssdk.services.sms.model.Connector Maven / Gradle / Ivy

Go to download

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.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
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.core.runtime.TypeConverter;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.services.sms.transform.ConnectorMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * Object representing a Connector
 */
@Generated("software.amazon.awssdk:codegen")
public final class Connector implements StructuredPojo, ToCopyableBuilder {
    private final String connectorId;

    private final String version;

    private final String status;

    private final List capabilityList;

    private final String vmManagerName;

    private final String vmManagerType;

    private final String vmManagerId;

    private final String ipAddress;

    private final String macAddress;

    private final Instant associatedOn;

    private Connector(BuilderImpl builder) {
        this.connectorId = builder.connectorId;
        this.version = builder.version;
        this.status = builder.status;
        this.capabilityList = builder.capabilityList;
        this.vmManagerName = builder.vmManagerName;
        this.vmManagerType = builder.vmManagerType;
        this.vmManagerId = builder.vmManagerId;
        this.ipAddress = builder.ipAddress;
        this.macAddress = builder.macAddress;
        this.associatedOn = builder.associatedOn;
    }

    /**
     * Returns the value of the ConnectorId property for this object.
     * 
     * @return The value of the ConnectorId property for this object.
     */
    public String connectorId() {
        return connectorId;
    }

    /**
     * Returns the value of the Version property for this object.
     * 
     * @return The value of the Version property for this object.
     */
    public String version() {
        return version;
    }

    /**
     * Returns the value of the Status property for this object.
     * 

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

* * @return The value of the Status property for this object. * @see ConnectorStatus */ public ConnectorStatus status() { return ConnectorStatus.fromValue(status); } /** * Returns the value of the Status property for this object. *

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

* * @return The value of the Status property for this object. * @see ConnectorStatus */ public String statusAsString() { return status; } /** * Returns the value of the CapabilityList property for this object. *

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The value of the CapabilityList property for this object. */ public List capabilityList() { return TypeConverter.convert(capabilityList, ConnectorCapability::fromValue); } /** * Returns the value of the CapabilityList property for this object. *

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The value of the CapabilityList property for this object. */ public List capabilityListAsStrings() { return capabilityList; } /** * 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 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 IpAddress property for this object. * * @return The value of the IpAddress property for this object. */ public String ipAddress() { return ipAddress; } /** * Returns the value of the MacAddress property for this object. * * @return The value of the MacAddress property for this object. */ public String macAddress() { return macAddress; } /** * Returns the value of the AssociatedOn property for this object. * * @return The value of the AssociatedOn property for this object. */ public Instant associatedOn() { return associatedOn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(connectorId()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(capabilityListAsStrings()); hashCode = 31 * hashCode + Objects.hashCode(vmManagerName()); hashCode = 31 * hashCode + Objects.hashCode(vmManagerTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(vmManagerId()); hashCode = 31 * hashCode + Objects.hashCode(ipAddress()); hashCode = 31 * hashCode + Objects.hashCode(macAddress()); hashCode = 31 * hashCode + Objects.hashCode(associatedOn()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Connector)) { return false; } Connector other = (Connector) obj; return Objects.equals(connectorId(), other.connectorId()) && Objects.equals(version(), other.version()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(capabilityListAsStrings(), other.capabilityListAsStrings()) && Objects.equals(vmManagerName(), other.vmManagerName()) && Objects.equals(vmManagerTypeAsString(), other.vmManagerTypeAsString()) && Objects.equals(vmManagerId(), other.vmManagerId()) && Objects.equals(ipAddress(), other.ipAddress()) && Objects.equals(macAddress(), other.macAddress()) && Objects.equals(associatedOn(), other.associatedOn()); } @Override public String toString() { return ToString.builder("Connector").add("ConnectorId", connectorId()).add("Version", version()) .add("Status", statusAsString()).add("CapabilityList", capabilityListAsStrings()) .add("VmManagerName", vmManagerName()).add("VmManagerType", vmManagerTypeAsString()) .add("VmManagerId", vmManagerId()).add("IpAddress", ipAddress()).add("MacAddress", macAddress()) .add("AssociatedOn", associatedOn()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "connectorId": return Optional.ofNullable(clazz.cast(connectorId())); case "version": return Optional.ofNullable(clazz.cast(version())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "capabilityList": return Optional.ofNullable(clazz.cast(capabilityListAsStrings())); case "vmManagerName": return Optional.ofNullable(clazz.cast(vmManagerName())); case "vmManagerType": return Optional.ofNullable(clazz.cast(vmManagerTypeAsString())); case "vmManagerId": return Optional.ofNullable(clazz.cast(vmManagerId())); case "ipAddress": return Optional.ofNullable(clazz.cast(ipAddress())); case "macAddress": return Optional.ofNullable(clazz.cast(macAddress())); case "associatedOn": return Optional.ofNullable(clazz.cast(associatedOn())); default: return Optional.empty(); } } @SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { ConnectorMarshaller.getInstance().marshall(this, protocolMarshaller); } public interface Builder extends CopyableBuilder { /** * Sets the value of the ConnectorId property for this object. * * @param connectorId * The new value for the ConnectorId property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectorId(String connectorId); /** * Sets the value of the Version property for this object. * * @param version * The new value for the Version property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder version(String version); /** * Sets the value of the Status property for this object. * * @param status * The new value for the Status property for this object. * @see ConnectorStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectorStatus */ Builder status(String status); /** * Sets the value of the Status property for this object. * * @param status * The new value for the Status property for this object. * @see ConnectorStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectorStatus */ Builder status(ConnectorStatus status); /** * Sets the value of the CapabilityList property for this object. * * @param capabilityList * The new value for the CapabilityList property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capabilityListWithStrings(Collection capabilityList); /** * Sets the value of the CapabilityList property for this object. * * @param capabilityList * The new value for the CapabilityList property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capabilityListWithStrings(String... capabilityList); /** * Sets the value of the CapabilityList property for this object. * * @param capabilityList * The new value for the CapabilityList property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capabilityList(Collection capabilityList); /** * Sets the value of the CapabilityList property for this object. * * @param capabilityList * The new value for the CapabilityList property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capabilityList(ConnectorCapability... capabilityList); /** * 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 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 IpAddress property for this object. * * @param ipAddress * The new value for the IpAddress property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipAddress(String ipAddress); /** * Sets the value of the MacAddress property for this object. * * @param macAddress * The new value for the MacAddress property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder macAddress(String macAddress); /** * Sets the value of the AssociatedOn property for this object. * * @param associatedOn * The new value for the AssociatedOn property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associatedOn(Instant associatedOn); } static final class BuilderImpl implements Builder { private String connectorId; private String version; private String status; private List capabilityList = DefaultSdkAutoConstructList.getInstance(); private String vmManagerName; private String vmManagerType; private String vmManagerId; private String ipAddress; private String macAddress; private Instant associatedOn; private BuilderImpl() { } private BuilderImpl(Connector model) { connectorId(model.connectorId); version(model.version); status(model.status); capabilityListWithStrings(model.capabilityList); vmManagerName(model.vmManagerName); vmManagerType(model.vmManagerType); vmManagerId(model.vmManagerId); ipAddress(model.ipAddress); macAddress(model.macAddress); associatedOn(model.associatedOn); } public final String getConnectorId() { return connectorId; } @Override public final Builder connectorId(String connectorId) { this.connectorId = connectorId; return this; } public final void setConnectorId(String connectorId) { this.connectorId = connectorId; } public final String getVersion() { return version; } @Override public final Builder version(String version) { this.version = version; return this; } public final void setVersion(String version) { this.version = version; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ConnectorStatus status) { this.status(status.toString()); return this; } public final void setStatus(String status) { this.status = status; } public final Collection getCapabilityList() { return capabilityList; } @Override public final Builder capabilityListWithStrings(Collection capabilityList) { this.capabilityList = ConnectorCapabilityListCopier.copy(capabilityList); return this; } @Override @SafeVarargs public final Builder capabilityListWithStrings(String... capabilityList) { capabilityListWithStrings(Arrays.asList(capabilityList)); return this; } @Override public final Builder capabilityList(Collection capabilityList) { this.capabilityList = ConnectorCapabilityListCopier.copyEnumToString(capabilityList); return this; } @Override @SafeVarargs public final Builder capabilityList(ConnectorCapability... capabilityList) { capabilityList(Arrays.asList(capabilityList)); return this; } public final void setCapabilityList(Collection capabilityList) { this.capabilityList = ConnectorCapabilityListCopier.copy(capabilityList); } 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 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 getIpAddress() { return ipAddress; } @Override public final Builder ipAddress(String ipAddress) { this.ipAddress = ipAddress; return this; } public final void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } public final String getMacAddress() { return macAddress; } @Override public final Builder macAddress(String macAddress) { this.macAddress = macAddress; return this; } public final void setMacAddress(String macAddress) { this.macAddress = macAddress; } public final Instant getAssociatedOn() { return associatedOn; } @Override public final Builder associatedOn(Instant associatedOn) { this.associatedOn = associatedOn; return this; } public final void setAssociatedOn(Instant associatedOn) { this.associatedOn = associatedOn; } @Override public Connector build() { return new Connector(this); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy