/* * Copyright 2018-2023 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.codegurusecurity.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains information about the error that caused a finding to fail to be retrieved. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BatchGetFindingsError implements Serializable, Cloneable, StructuredPojo { /** ** A code associated with the type of error. *
*/ private String errorCode; /** ** The finding ID of the finding that was not fetched. *
*/ private String findingId; /** ** Describes the error. *
*/ private String message; /** ** The name of the scan that generated the finding. *
*/ private String scanName; /** ** A code associated with the type of error. *
* * @param errorCode * A code associated with the type of error. * @see ErrorCode */ public void setErrorCode(String errorCode) { this.errorCode = errorCode; } /** ** A code associated with the type of error. *
* * @return A code associated with the type of error. * @see ErrorCode */ public String getErrorCode() { return this.errorCode; } /** ** A code associated with the type of error. *
* * @param errorCode * A code associated with the type of error. * @return Returns a reference to this object so that method calls can be chained together. * @see ErrorCode */ public BatchGetFindingsError withErrorCode(String errorCode) { setErrorCode(errorCode); return this; } /** ** A code associated with the type of error. *
* * @param errorCode * A code associated with the type of error. * @return Returns a reference to this object so that method calls can be chained together. * @see ErrorCode */ public BatchGetFindingsError withErrorCode(ErrorCode errorCode) { this.errorCode = errorCode.toString(); return this; } /** ** The finding ID of the finding that was not fetched. *
* * @param findingId * The finding ID of the finding that was not fetched. */ public void setFindingId(String findingId) { this.findingId = findingId; } /** ** The finding ID of the finding that was not fetched. *
* * @return The finding ID of the finding that was not fetched. */ public String getFindingId() { return this.findingId; } /** ** The finding ID of the finding that was not fetched. *
* * @param findingId * The finding ID of the finding that was not fetched. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchGetFindingsError withFindingId(String findingId) { setFindingId(findingId); return this; } /** ** Describes the error. *
* * @param message * Describes the error. */ public void setMessage(String message) { this.message = message; } /** ** Describes the error. *
* * @return Describes the error. */ public String getMessage() { return this.message; } /** ** Describes the error. *
* * @param message * Describes the error. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchGetFindingsError withMessage(String message) { setMessage(message); return this; } /** ** The name of the scan that generated the finding. *
* * @param scanName * The name of the scan that generated the finding. */ public void setScanName(String scanName) { this.scanName = scanName; } /** ** The name of the scan that generated the finding. *
* * @return The name of the scan that generated the finding. */ public String getScanName() { return this.scanName; } /** ** The name of the scan that generated the finding. *
* * @param scanName * The name of the scan that generated the finding. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchGetFindingsError withScanName(String scanName) { setScanName(scanName); 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 (getErrorCode() != null) sb.append("ErrorCode: ").append(getErrorCode()).append(","); if (getFindingId() != null) sb.append("FindingId: ").append(getFindingId()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getScanName() != null) sb.append("ScanName: ").append(getScanName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchGetFindingsError == false) return false; BatchGetFindingsError other = (BatchGetFindingsError) obj; if (other.getErrorCode() == null ^ this.getErrorCode() == null) return false; if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == false) return false; if (other.getFindingId() == null ^ this.getFindingId() == null) return false; if (other.getFindingId() != null && other.getFindingId().equals(this.getFindingId()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getScanName() == null ^ this.getScanName() == null) return false; if (other.getScanName() != null && other.getScanName().equals(this.getScanName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode()); hashCode = prime * hashCode + ((getFindingId() == null) ? 0 : getFindingId().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getScanName() == null) ? 0 : getScanName().hashCode()); return hashCode; } @Override public BatchGetFindingsError clone() { try { return (BatchGetFindingsError) 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.codegurusecurity.model.transform.BatchGetFindingsErrorMarshaller.getInstance().marshall(this, protocolMarshaller); } }