com.amazonaws.services.devicefarm.model.Problem Maven / Gradle / Ivy
Show all versions of aws-java-sdk-devicefarm 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.devicefarm.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Represents a specific warning or failure.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Problem implements Serializable, Cloneable, StructuredPojo {
/**
*
* Information about the associated run.
*
*/
private ProblemDetail run;
/**
*
* Information about the associated job.
*
*/
private ProblemDetail job;
/**
*
* Information about the associated suite.
*
*/
private ProblemDetail suite;
/**
*
* Information about the associated test.
*
*/
private ProblemDetail test;
/**
*
* Information about the associated device.
*
*/
private Device device;
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*/
private String result;
/**
*
* A message about the problem's result.
*
*/
private String message;
/**
*
* Information about the associated run.
*
*
* @param run
* Information about the associated run.
*/
public void setRun(ProblemDetail run) {
this.run = run;
}
/**
*
* Information about the associated run.
*
*
* @return Information about the associated run.
*/
public ProblemDetail getRun() {
return this.run;
}
/**
*
* Information about the associated run.
*
*
* @param run
* Information about the associated run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withRun(ProblemDetail run) {
setRun(run);
return this;
}
/**
*
* Information about the associated job.
*
*
* @param job
* Information about the associated job.
*/
public void setJob(ProblemDetail job) {
this.job = job;
}
/**
*
* Information about the associated job.
*
*
* @return Information about the associated job.
*/
public ProblemDetail getJob() {
return this.job;
}
/**
*
* Information about the associated job.
*
*
* @param job
* Information about the associated job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withJob(ProblemDetail job) {
setJob(job);
return this;
}
/**
*
* Information about the associated suite.
*
*
* @param suite
* Information about the associated suite.
*/
public void setSuite(ProblemDetail suite) {
this.suite = suite;
}
/**
*
* Information about the associated suite.
*
*
* @return Information about the associated suite.
*/
public ProblemDetail getSuite() {
return this.suite;
}
/**
*
* Information about the associated suite.
*
*
* @param suite
* Information about the associated suite.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withSuite(ProblemDetail suite) {
setSuite(suite);
return this;
}
/**
*
* Information about the associated test.
*
*
* @param test
* Information about the associated test.
*/
public void setTest(ProblemDetail test) {
this.test = test;
}
/**
*
* Information about the associated test.
*
*
* @return Information about the associated test.
*/
public ProblemDetail getTest() {
return this.test;
}
/**
*
* Information about the associated test.
*
*
* @param test
* Information about the associated test.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withTest(ProblemDetail test) {
setTest(test);
return this;
}
/**
*
* Information about the associated device.
*
*
* @param device
* Information about the associated device.
*/
public void setDevice(Device device) {
this.device = device;
}
/**
*
* Information about the associated device.
*
*
* @return Information about the associated device.
*/
public Device getDevice() {
return this.device;
}
/**
*
* Information about the associated device.
*
*
* @param device
* Information about the associated device.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withDevice(Device device) {
setDevice(device);
return this;
}
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*
* @param result
* The problem's result.
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
* @see ExecutionResult
*/
public void setResult(String result) {
this.result = result;
}
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*
* @return The problem's result.
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
* @see ExecutionResult
*/
public String getResult() {
return this.result;
}
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*
* @param result
* The problem's result.
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ExecutionResult
*/
public Problem withResult(String result) {
setResult(result);
return this;
}
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*
* @param result
* The problem's result.
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
* @see ExecutionResult
*/
public void setResult(ExecutionResult result) {
withResult(result);
}
/**
*
* The problem's result.
*
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
*
*
* @param result
* The problem's result.
*
* Allowed values include:
*
*
* -
*
* PENDING
*
*
* -
*
* PASSED
*
*
* -
*
* WARNED
*
*
* -
*
* FAILED
*
*
* -
*
* SKIPPED
*
*
* -
*
* ERRORED
*
*
* -
*
* STOPPED
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ExecutionResult
*/
public Problem withResult(ExecutionResult result) {
this.result = result.toString();
return this;
}
/**
*
* A message about the problem's result.
*
*
* @param message
* A message about the problem's result.
*/
public void setMessage(String message) {
this.message = message;
}
/**
*
* A message about the problem's result.
*
*
* @return A message about the problem's result.
*/
public String getMessage() {
return this.message;
}
/**
*
* A message about the problem's result.
*
*
* @param message
* A message about the problem's result.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Problem withMessage(String message) {
setMessage(message);
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 (getRun() != null)
sb.append("Run: ").append(getRun()).append(",");
if (getJob() != null)
sb.append("Job: ").append(getJob()).append(",");
if (getSuite() != null)
sb.append("Suite: ").append(getSuite()).append(",");
if (getTest() != null)
sb.append("Test: ").append(getTest()).append(",");
if (getDevice() != null)
sb.append("Device: ").append(getDevice()).append(",");
if (getResult() != null)
sb.append("Result: ").append(getResult()).append(",");
if (getMessage() != null)
sb.append("Message: ").append(getMessage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Problem == false)
return false;
Problem other = (Problem) obj;
if (other.getRun() == null ^ this.getRun() == null)
return false;
if (other.getRun() != null && other.getRun().equals(this.getRun()) == false)
return false;
if (other.getJob() == null ^ this.getJob() == null)
return false;
if (other.getJob() != null && other.getJob().equals(this.getJob()) == false)
return false;
if (other.getSuite() == null ^ this.getSuite() == null)
return false;
if (other.getSuite() != null && other.getSuite().equals(this.getSuite()) == false)
return false;
if (other.getTest() == null ^ this.getTest() == null)
return false;
if (other.getTest() != null && other.getTest().equals(this.getTest()) == false)
return false;
if (other.getDevice() == null ^ this.getDevice() == null)
return false;
if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == false)
return false;
if (other.getResult() == null ^ this.getResult() == null)
return false;
if (other.getResult() != null && other.getResult().equals(this.getResult()) == false)
return false;
if (other.getMessage() == null ^ this.getMessage() == null)
return false;
if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRun() == null) ? 0 : getRun().hashCode());
hashCode = prime * hashCode + ((getJob() == null) ? 0 : getJob().hashCode());
hashCode = prime * hashCode + ((getSuite() == null) ? 0 : getSuite().hashCode());
hashCode = prime * hashCode + ((getTest() == null) ? 0 : getTest().hashCode());
hashCode = prime * hashCode + ((getDevice() == null) ? 0 : getDevice().hashCode());
hashCode = prime * hashCode + ((getResult() == null) ? 0 : getResult().hashCode());
hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode());
return hashCode;
}
@Override
public Problem clone() {
try {
return (Problem) 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.devicefarm.model.transform.ProblemMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}