com.amazonaws.services.resiliencehub.model.ResourceIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-resiliencehub Show documentation
Show all versions of aws-java-sdk-resiliencehub Show documentation
The AWS Java SDK for AWS Resilience Hub module holds the client classes that are used for communicating with AWS Resilience Hub Service
The newest version!
/*
* 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.resiliencehub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Defines a resource identifier for the drifted resource.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceIdentifier implements Serializable, Cloneable, StructuredPojo {
/**
*
* Logical identifier of the drifted resource.
*
*/
private LogicalResourceId logicalResourceId;
/**
*
* Type of the drifted resource.
*
*/
private String resourceType;
/**
*
* Logical identifier of the drifted resource.
*
*
* @param logicalResourceId
* Logical identifier of the drifted resource.
*/
public void setLogicalResourceId(LogicalResourceId logicalResourceId) {
this.logicalResourceId = logicalResourceId;
}
/**
*
* Logical identifier of the drifted resource.
*
*
* @return Logical identifier of the drifted resource.
*/
public LogicalResourceId getLogicalResourceId() {
return this.logicalResourceId;
}
/**
*
* Logical identifier of the drifted resource.
*
*
* @param logicalResourceId
* Logical identifier of the drifted resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withLogicalResourceId(LogicalResourceId logicalResourceId) {
setLogicalResourceId(logicalResourceId);
return this;
}
/**
*
* Type of the drifted resource.
*
*
* @param resourceType
* Type of the drifted resource.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* Type of the drifted resource.
*
*
* @return Type of the drifted resource.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* Type of the drifted resource.
*
*
* @param resourceType
* Type of the drifted resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withResourceType(String resourceType) {
setResourceType(resourceType);
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 (getLogicalResourceId() != null)
sb.append("LogicalResourceId: ").append(getLogicalResourceId()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceIdentifier == false)
return false;
ResourceIdentifier other = (ResourceIdentifier) obj;
if (other.getLogicalResourceId() == null ^ this.getLogicalResourceId() == null)
return false;
if (other.getLogicalResourceId() != null && other.getLogicalResourceId().equals(this.getLogicalResourceId()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLogicalResourceId() == null) ? 0 : getLogicalResourceId().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
return hashCode;
}
@Override
public ResourceIdentifier clone() {
try {
return (ResourceIdentifier) 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.resiliencehub.model.transform.ResourceIdentifierMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}