Class JobStatus

java.lang.Object
com.dropbox.core.v2.sharing.JobStatus

public final class JobStatus extends Object
This class is a tagged union. Tagged unions instances are always associated to a specific tag. This means only one of the isAbc() methods will return true. You can use tag() to determine the tag associated with this instance.
  • Field Details

    • IN_PROGRESS

      public static final JobStatus IN_PROGRESS
      The asynchronous job is still in progress.
    • COMPLETE

      public static final JobStatus COMPLETE
      The asynchronous job has finished.
  • Method Details

    • tag

      public JobStatus.Tag tag()
      Returns the tag for this instance.

      This class is a tagged union. Tagged unions instances are always associated to a specific tag. This means only one of the isXyz() methods will return true. Callers are recommended to use the tag value in a switch statement to properly handle the different values for this JobStatus.

      Returns:
      the tag for this instance.
    • isInProgress

      public boolean isInProgress()
      Returns true if this instance has the tag JobStatus.Tag.IN_PROGRESS, false otherwise.
      Returns:
      true if this instance is tagged as JobStatus.Tag.IN_PROGRESS, false otherwise.
    • isComplete

      public boolean isComplete()
      Returns true if this instance has the tag JobStatus.Tag.COMPLETE, false otherwise.
      Returns:
      true if this instance is tagged as JobStatus.Tag.COMPLETE, false otherwise.
    • isFailed

      public boolean isFailed()
      Returns true if this instance has the tag JobStatus.Tag.FAILED, false otherwise.
      Returns:
      true if this instance is tagged as JobStatus.Tag.FAILED, false otherwise.
    • failed

      public static JobStatus failed(JobError value)
      Returns an instance of JobStatus that has its tag set to JobStatus.Tag.FAILED.

      The asynchronous job returned an error.

      Parameters:
      value - value to assign to this instance.
      Returns:
      Instance of JobStatus with its tag set to JobStatus.Tag.FAILED.
      Throws:
      IllegalArgumentException - if value is null.
    • getFailedValue

      public JobError getFailedValue()
      The asynchronous job returned an error.

      This instance must be tagged as JobStatus.Tag.FAILED.

      Returns:
      The JobError value associated with this instance if isFailed() is true.
      Throws:
      IllegalStateException - If isFailed() is false.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public String toStringMultiline()
      Returns a String representation of this object formatted for easier readability.

      The returned String may contain newlines.

      Returns:
      Formatted, multiline String representation of this object