Class MediaInfo

java.lang.Object
com.dropbox.core.v2.files.MediaInfo

public final class MediaInfo 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

    • PENDING

      public static final MediaInfo PENDING
      Indicate the photo/video is still under processing and metadata is not available yet.
  • Method Details

    • tag

      public MediaInfo.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 MediaInfo.

      Returns:
      the tag for this instance.
    • isPending

      public boolean isPending()
      Returns true if this instance has the tag MediaInfo.Tag.PENDING, false otherwise.
      Returns:
      true if this instance is tagged as MediaInfo.Tag.PENDING, false otherwise.
    • isMetadata

      public boolean isMetadata()
      Returns true if this instance has the tag MediaInfo.Tag.METADATA, false otherwise.
      Returns:
      true if this instance is tagged as MediaInfo.Tag.METADATA, false otherwise.
    • metadata

      public static MediaInfo metadata(MediaMetadata value)
      Returns an instance of MediaInfo that has its tag set to MediaInfo.Tag.METADATA.

      The metadata for the photo/video. Uses MediaMetadataAbstract to preserve photo/video subtypes (e.g. VideoMetadata.duration).

      Parameters:
      value - value to assign to this instance.
      Returns:
      Instance of MediaInfo with its tag set to MediaInfo.Tag.METADATA.
      Throws:
      IllegalArgumentException - if value is null.
    • getMetadataValue

      public MediaMetadata getMetadataValue()
      The metadata for the photo/video. Uses MediaMetadataAbstract to preserve photo/video subtypes (e.g. VideoMetadata.duration).

      This instance must be tagged as MediaInfo.Tag.METADATA.

      Returns:
      The MediaMetadata value associated with this instance if isMetadata() is true.
      Throws:
      IllegalStateException - If isMetadata() 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