Class ThumbnailArg.Builder

java.lang.Object
com.dropbox.core.v2.files.ThumbnailArg.Builder
Enclosing class:
ThumbnailArg

public static class ThumbnailArg.Builder extends Object
Builder for ThumbnailArg.
  • Field Details

  • Constructor Details

    • Builder

      protected Builder(String path)
  • Method Details

    • withFormat

      public ThumbnailArg.Builder withFormat(ThumbnailFormat format)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailFormat.JPEG.

      Parameters:
      format - The format for the thumbnail image, jpeg (default), png, or webp. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts, and web for compression. Must not be null. Defaults to ThumbnailFormat.JPEG when set to null.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withSize

      public ThumbnailArg.Builder withSize(ThumbnailSize size)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailSize.W64H64.

      Parameters:
      size - The size for the thumbnail image. Must not be null. Defaults to ThumbnailSize.W64H64 when set to null.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withMode

      public ThumbnailArg.Builder withMode(ThumbnailMode mode)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailMode.STRICT.

      Parameters:
      mode - How to resize and crop the image to achieve the desired size. Must not be null. Defaults to ThumbnailMode.STRICT when set to null.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withQuality

      public ThumbnailArg.Builder withQuality(ThumbnailQuality quality)
      Set value for optional field.

      If left unset or set to null, defaults to ThumbnailQuality.QUALITY_80.

      Parameters:
      quality - Quality of the thumbnail image. Must not be null. Defaults to ThumbnailQuality.QUALITY_80 when set to null.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withExcludeMediaInfo

      public ThumbnailArg.Builder withExcludeMediaInfo(Boolean excludeMediaInfo)
      Set value for optional field.
      Parameters:
      excludeMediaInfo - Normally, FileMetadata.getMediaInfo() is set for photo and video. When this flag is true, FileMetadata.getMediaInfo() is not populated. This improves latency for use cases where `media_info` is not needed.
      Returns:
      this builder
    • build

      public ThumbnailArg build()
      Builds an instance of ThumbnailArg configured with this builder's values
      Returns:
      new instance of ThumbnailArg