com.amazonaws.services.workspaces.model.BundleResourceAssociation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-workspaces Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.workspaces.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the association between an application and a bundle resource.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BundleResourceAssociation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The identifier of the associated resource.
*
*/
private String associatedResourceId;
/**
*
* The resource type of the associated resources.
*
*/
private String associatedResourceType;
/**
*
* The identifier of the bundle.
*
*/
private String bundleId;
/**
*
* The time the association is created.
*
*/
private java.util.Date created;
/**
*
* The time the association status was last updated.
*
*/
private java.util.Date lastUpdatedTime;
/**
*
* The status of the bundle resource association.
*
*/
private String state;
/**
*
* The reason the association deployment failed.
*
*/
private AssociationStateReason stateReason;
/**
*
* The identifier of the associated resource.
*
*
* @param associatedResourceId
* The identifier of the associated resource.
*/
public void setAssociatedResourceId(String associatedResourceId) {
this.associatedResourceId = associatedResourceId;
}
/**
*
* The identifier of the associated resource.
*
*
* @return The identifier of the associated resource.
*/
public String getAssociatedResourceId() {
return this.associatedResourceId;
}
/**
*
* The identifier of the associated resource.
*
*
* @param associatedResourceId
* The identifier of the associated resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BundleResourceAssociation withAssociatedResourceId(String associatedResourceId) {
setAssociatedResourceId(associatedResourceId);
return this;
}
/**
*
* The resource type of the associated resources.
*
*
* @param associatedResourceType
* The resource type of the associated resources.
* @see BundleAssociatedResourceType
*/
public void setAssociatedResourceType(String associatedResourceType) {
this.associatedResourceType = associatedResourceType;
}
/**
*
* The resource type of the associated resources.
*
*
* @return The resource type of the associated resources.
* @see BundleAssociatedResourceType
*/
public String getAssociatedResourceType() {
return this.associatedResourceType;
}
/**
*
* The resource type of the associated resources.
*
*
* @param associatedResourceType
* The resource type of the associated resources.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BundleAssociatedResourceType
*/
public BundleResourceAssociation withAssociatedResourceType(String associatedResourceType) {
setAssociatedResourceType(associatedResourceType);
return this;
}
/**
*
* The resource type of the associated resources.
*
*
* @param associatedResourceType
* The resource type of the associated resources.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BundleAssociatedResourceType
*/
public BundleResourceAssociation withAssociatedResourceType(BundleAssociatedResourceType associatedResourceType) {
this.associatedResourceType = associatedResourceType.toString();
return this;
}
/**
*
* The identifier of the bundle.
*
*
* @param bundleId
* The identifier of the bundle.
*/
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
/**
*
* The identifier of the bundle.
*
*
* @return The identifier of the bundle.
*/
public String getBundleId() {
return this.bundleId;
}
/**
*
* The identifier of the bundle.
*
*
* @param bundleId
* The identifier of the bundle.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BundleResourceAssociation withBundleId(String bundleId) {
setBundleId(bundleId);
return this;
}
/**
*
* The time the association is created.
*
*
* @param created
* The time the association is created.
*/
public void setCreated(java.util.Date created) {
this.created = created;
}
/**
*
* The time the association is created.
*
*
* @return The time the association is created.
*/
public java.util.Date getCreated() {
return this.created;
}
/**
*
* The time the association is created.
*
*
* @param created
* The time the association is created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BundleResourceAssociation withCreated(java.util.Date created) {
setCreated(created);
return this;
}
/**
*
* The time the association status was last updated.
*
*
* @param lastUpdatedTime
* The time the association status was last updated.
*/
public void setLastUpdatedTime(java.util.Date lastUpdatedTime) {
this.lastUpdatedTime = lastUpdatedTime;
}
/**
*
* The time the association status was last updated.
*
*
* @return The time the association status was last updated.
*/
public java.util.Date getLastUpdatedTime() {
return this.lastUpdatedTime;
}
/**
*
* The time the association status was last updated.
*
*
* @param lastUpdatedTime
* The time the association status was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BundleResourceAssociation withLastUpdatedTime(java.util.Date lastUpdatedTime) {
setLastUpdatedTime(lastUpdatedTime);
return this;
}
/**
*
* The status of the bundle resource association.
*
*
* @param state
* The status of the bundle resource association.
* @see AssociationState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The status of the bundle resource association.
*
*
* @return The status of the bundle resource association.
* @see AssociationState
*/
public String getState() {
return this.state;
}
/**
*
* The status of the bundle resource association.
*
*
* @param state
* The status of the bundle resource association.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssociationState
*/
public BundleResourceAssociation withState(String state) {
setState(state);
return this;
}
/**
*
* The status of the bundle resource association.
*
*
* @param state
* The status of the bundle resource association.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AssociationState
*/
public BundleResourceAssociation withState(AssociationState state) {
this.state = state.toString();
return this;
}
/**
*
* The reason the association deployment failed.
*
*
* @param stateReason
* The reason the association deployment failed.
*/
public void setStateReason(AssociationStateReason stateReason) {
this.stateReason = stateReason;
}
/**
*
* The reason the association deployment failed.
*
*
* @return The reason the association deployment failed.
*/
public AssociationStateReason getStateReason() {
return this.stateReason;
}
/**
*
* The reason the association deployment failed.
*
*
* @param stateReason
* The reason the association deployment failed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BundleResourceAssociation withStateReason(AssociationStateReason stateReason) {
setStateReason(stateReason);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAssociatedResourceId() != null)
sb.append("AssociatedResourceId: ").append(getAssociatedResourceId()).append(",");
if (getAssociatedResourceType() != null)
sb.append("AssociatedResourceType: ").append(getAssociatedResourceType()).append(",");
if (getBundleId() != null)
sb.append("BundleId: ").append(getBundleId()).append(",");
if (getCreated() != null)
sb.append("Created: ").append(getCreated()).append(",");
if (getLastUpdatedTime() != null)
sb.append("LastUpdatedTime: ").append(getLastUpdatedTime()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getStateReason() != null)
sb.append("StateReason: ").append(getStateReason());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BundleResourceAssociation == false)
return false;
BundleResourceAssociation other = (BundleResourceAssociation) obj;
if (other.getAssociatedResourceId() == null ^ this.getAssociatedResourceId() == null)
return false;
if (other.getAssociatedResourceId() != null && other.getAssociatedResourceId().equals(this.getAssociatedResourceId()) == false)
return false;
if (other.getAssociatedResourceType() == null ^ this.getAssociatedResourceType() == null)
return false;
if (other.getAssociatedResourceType() != null && other.getAssociatedResourceType().equals(this.getAssociatedResourceType()) == false)
return false;
if (other.getBundleId() == null ^ this.getBundleId() == null)
return false;
if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == false)
return false;
if (other.getCreated() == null ^ this.getCreated() == null)
return false;
if (other.getCreated() != null && other.getCreated().equals(this.getCreated()) == false)
return false;
if (other.getLastUpdatedTime() == null ^ this.getLastUpdatedTime() == null)
return false;
if (other.getLastUpdatedTime() != null && other.getLastUpdatedTime().equals(this.getLastUpdatedTime()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getStateReason() == null ^ this.getStateReason() == null)
return false;
if (other.getStateReason() != null && other.getStateReason().equals(this.getStateReason()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAssociatedResourceId() == null) ? 0 : getAssociatedResourceId().hashCode());
hashCode = prime * hashCode + ((getAssociatedResourceType() == null) ? 0 : getAssociatedResourceType().hashCode());
hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode());
hashCode = prime * hashCode + ((getCreated() == null) ? 0 : getCreated().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedTime() == null) ? 0 : getLastUpdatedTime().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode());
return hashCode;
}
@Override
public BundleResourceAssociation clone() {
try {
return (BundleResourceAssociation) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.workspaces.model.transform.BundleResourceAssociationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}