Class ThumbnailArg.Builder

  • Enclosing class:
    ThumbnailArg

    public static class ThumbnailArg.Builder
    extends java.lang.Object
    Builder for ThumbnailArg.
    • Constructor Detail

      • Builder

        protected Builder​(java.lang.String path)
    • Method Detail

      • 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) or png. For images that are photos, jpeg should be preferred, while png is better for screenshots and digital arts. Must not be null. Defaults to ThumbnailFormat.JPEG when set to null.
        Returns:
        this builder
        Throws:
        java.lang.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:
        java.lang.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:
        java.lang.IllegalArgumentException - If any argument does not meet its preconditions.