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

com.amazonaws.services.devicefarm.model.Problem Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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;

/**
 * 

* Represents a specific warning or failure. *

*/ public class Problem implements Serializable, Cloneable { /** *

* 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: A pending condition. *

    *
  • *
  • *

    * PASSED: A passing condition. *

    *
  • *
  • *

    * WARNED: A warning condition. *

    *
  • *
  • *

    * FAILED: A failed condition. *

    *
  • *
  • *

    * SKIPPED: A skipped condition. *

    *
  • *
  • *

    * ERRORED: An error condition. *

    *
  • *
  • *

    * STOPPED: A stopped condition. *

    *
  • *
*/ 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: A pending condition. *

    *
  • *
  • *

    * PASSED: A passing condition. *

    *
  • *
  • *

    * WARNED: A warning condition. *

    *
  • *
  • *

    * FAILED: A failed condition. *

    *
  • *
  • *

    * SKIPPED: A skipped condition. *

    *
  • *
  • *

    * ERRORED: An error condition. *

    *
  • *
  • *

    * STOPPED: A stopped condition. *

    *
  • *
* * @param result * The problem's result.

*

* Allowed values include: *

*
    *
  • *

    * PENDING: A pending condition. *

    *
  • *
  • *

    * PASSED: A passing condition. *

    *
  • *
  • *

    * WARNED: A warning condition. *

    *
  • *
  • *

    * FAILED: A failed condition. *

    *
  • *
  • *

    * SKIPPED: A skipped condition. *

    *
  • *
  • *

    * ERRORED: An error condition. *

    *
  • *
  • *

    * STOPPED: A stopped condition. *

    *
  • * @see ExecutionResult */ public void setResult(String result) { this.result = result; } /** *

    * The problem's result. *

    *

    * Allowed values include: *

    *
      *
    • *

      * PENDING: A pending condition. *

      *
    • *
    • *

      * PASSED: A passing condition. *

      *
    • *
    • *

      * WARNED: A warning condition. *

      *
    • *
    • *

      * FAILED: A failed condition. *

      *
    • *
    • *

      * SKIPPED: A skipped condition. *

      *
    • *
    • *

      * ERRORED: An error condition. *

      *
    • *
    • *

      * STOPPED: A stopped condition. *

      *
    • *
    * * @return The problem's result.

    *

    * Allowed values include: *

    *
      *
    • *

      * PENDING: A pending condition. *

      *
    • *
    • *

      * PASSED: A passing condition. *

      *
    • *
    • *

      * WARNED: A warning condition. *

      *
    • *
    • *

      * FAILED: A failed condition. *

      *
    • *
    • *

      * SKIPPED: A skipped condition. *

      *
    • *
    • *

      * ERRORED: An error condition. *

      *
    • *
    • *

      * STOPPED: A stopped condition. *

      *
    • * @see ExecutionResult */ public String getResult() { return this.result; } /** *

      * The problem's result. *

      *

      * Allowed values include: *

      *
        *
      • *

        * PENDING: A pending condition. *

        *
      • *
      • *

        * PASSED: A passing condition. *

        *
      • *
      • *

        * WARNED: A warning condition. *

        *
      • *
      • *

        * FAILED: A failed condition. *

        *
      • *
      • *

        * SKIPPED: A skipped condition. *

        *
      • *
      • *

        * ERRORED: An error condition. *

        *
      • *
      • *

        * STOPPED: A stopped condition. *

        *
      • *
      * * @param result * The problem's result.

      *

      * Allowed values include: *

      *
        *
      • *

        * PENDING: A pending condition. *

        *
      • *
      • *

        * PASSED: A passing condition. *

        *
      • *
      • *

        * WARNED: A warning condition. *

        *
      • *
      • *

        * FAILED: A failed condition. *

        *
      • *
      • *

        * SKIPPED: A skipped condition. *

        *
      • *
      • *

        * ERRORED: An error condition. *

        *
      • *
      • *

        * STOPPED: A stopped condition. *

        *
      • * @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: A pending condition. *

          *
        • *
        • *

          * PASSED: A passing condition. *

          *
        • *
        • *

          * WARNED: A warning condition. *

          *
        • *
        • *

          * FAILED: A failed condition. *

          *
        • *
        • *

          * SKIPPED: A skipped condition. *

          *
        • *
        • *

          * ERRORED: An error condition. *

          *
        • *
        • *

          * STOPPED: A stopped condition. *

          *
        • *
        * * @param result * The problem's result.

        *

        * Allowed values include: *

        *
          *
        • *

          * PENDING: A pending condition. *

          *
        • *
        • *

          * PASSED: A passing condition. *

          *
        • *
        • *

          * WARNED: A warning condition. *

          *
        • *
        • *

          * FAILED: A failed condition. *

          *
        • *
        • *

          * SKIPPED: A skipped condition. *

          *
        • *
        • *

          * ERRORED: An error condition. *

          *
        • *
        • *

          * STOPPED: A stopped condition. *

          *
        • * @see ExecutionResult */ public void setResult(ExecutionResult result) { this.result = result.toString(); } /** *

          * The problem's result. *

          *

          * Allowed values include: *

          *
            *
          • *

            * PENDING: A pending condition. *

            *
          • *
          • *

            * PASSED: A passing condition. *

            *
          • *
          • *

            * WARNED: A warning condition. *

            *
          • *
          • *

            * FAILED: A failed condition. *

            *
          • *
          • *

            * SKIPPED: A skipped condition. *

            *
          • *
          • *

            * ERRORED: An error condition. *

            *
          • *
          • *

            * STOPPED: A stopped condition. *

            *
          • *
          * * @param result * The problem's result.

          *

          * Allowed values include: *

          *
            *
          • *

            * PENDING: A pending condition. *

            *
          • *
          • *

            * PASSED: A passing condition. *

            *
          • *
          • *

            * WARNED: A warning condition. *

            *
          • *
          • *

            * FAILED: A failed condition. *

            *
          • *
          • *

            * SKIPPED: A skipped condition. *

            *
          • *
          • *

            * ERRORED: An error condition. *

            *
          • *
          • *

            * STOPPED: A stopped condition. *

            *
          • * @return Returns a reference to this object so that method calls can be * chained together. * @see ExecutionResult */ public Problem withResult(ExecutionResult result) { setResult(result); 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; useful for testing and * debugging. * * @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: " + getRun() + ","); if (getJob() != null) sb.append("Job: " + getJob() + ","); if (getSuite() != null) sb.append("Suite: " + getSuite() + ","); if (getTest() != null) sb.append("Test: " + getTest() + ","); if (getDevice() != null) sb.append("Device: " + getDevice() + ","); if (getResult() != null) sb.append("Result: " + getResult() + ","); if (getMessage() != null) sb.append("Message: " + 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); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy