Package com.dropbox.core.v2.files
Class ThumbnailArg.Builder
- java.lang.Object
-
- com.dropbox.core.v2.files.ThumbnailArg.Builder
-
- Enclosing class:
- ThumbnailArg
public static class ThumbnailArg.Builder extends java.lang.Object
Builder forThumbnailArg
.
-
-
Field Summary
Fields Modifier and Type Field Description protected ThumbnailFormat
format
protected ThumbnailMode
mode
protected java.lang.String
path
protected ThumbnailSize
size
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThumbnailArg
build()
Builds an instance ofThumbnailArg
configured with this builder's valuesThumbnailArg.Builder
withFormat(ThumbnailFormat format)
Set value for optional field.ThumbnailArg.Builder
withMode(ThumbnailMode mode)
Set value for optional field.ThumbnailArg.Builder
withSize(ThumbnailSize size)
Set value for optional field.
-
-
-
Field Detail
-
path
protected final java.lang.String path
-
format
protected ThumbnailFormat format
-
size
protected ThumbnailSize size
-
mode
protected ThumbnailMode mode
-
-
Method Detail
-
withFormat
public ThumbnailArg.Builder withFormat(ThumbnailFormat format)
Set value for optional field.If left unset or set to
null
, defaults toThumbnailFormat.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 benull
. Defaults toThumbnailFormat.JPEG
when set tonull
.- 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 toThumbnailSize.W64H64
.- Parameters:
size
- The size for the thumbnail image. Must not benull
. Defaults toThumbnailSize.W64H64
when set tonull
.- 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 toThumbnailMode.STRICT
.- Parameters:
mode
- How to resize and crop the image to achieve the desired size. Must not benull
. Defaults toThumbnailMode.STRICT
when set tonull
.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
build
public ThumbnailArg build()
Builds an instance ofThumbnailArg
configured with this builder's values- Returns:
- new instance of
ThumbnailArg
-
-