Package de.xima.fc.common.image
Class ImageThumbnailGeneratorConstraints
- java.lang.Object
-
- de.xima.fc.common.image.ImageThumbnailGeneratorConstraints
-
- All Implemented Interfaces:
Serializable
public final class ImageThumbnailGeneratorConstraints extends Object implements Serializable
Constraints for generating image thumbnails, seeIImageThumbnailGenerator
.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageThumbnailGeneratorConstraints.Builder
A builder forImageThumbnailGeneratorConstraints
.
-
Method Summary
-
-
-
Method Detail
-
targetHeight
public Integer targetHeight()
Gets the constraint on the target height for the thumbnail.- Returns:
- The target height in pixels, or null if no constraint is set.
-
targetWidth
public Integer targetWidth()
Gets the constraint on the target width for the thumbnail.- Returns:
- The target width in pixels, or null if no constraint is set.
-
toCanonicalRepresentation
public String toCanonicalRepresentation()
Gets the canonical string representation of this constraints set. This is compatible with equals, i.e. two constraints sets that areObject.equals(Object)
have the same canonical representation. The canonical string representation can be parsed byofCanonicalRepresentation(String)
.- Returns:
- The canonical representation.
-
builder
public static ImageThumbnailGeneratorConstraints.Builder builder()
Creates a new builder forImageThumbnailGeneratorConstraints
.- Returns:
- The new builder.
-
none
public static ImageThumbnailGeneratorConstraints none()
Gets aImageThumbnailGeneratorConstraints
object with no constraints.- Returns:
- An object representing no constraints.
-
ofCanonicalRepresentation
public static ImageThumbnailGeneratorConstraints ofCanonicalRepresentation(String canonicalRepresentation)
Parses acanonical representation
of constraints into aImageThumbnailGeneratorConstraints
object.- Parameters:
canonicalRepresentation
- The canonical representation.- Returns:
- The constraints object, or
none()
if the string is empty, or null if the string is or null. - Throws:
IllegalArgumentException
- If the canonical representation is invalid.
-
ofCanonicalRepresentationOrNull
public static ImageThumbnailGeneratorConstraints ofCanonicalRepresentationOrNull(String canonicalRepresentation)
Parses acanonical representation
of constraints into aImageThumbnailGeneratorConstraints
object.- Parameters:
canonicalRepresentation
- The canonical representation.- Returns:
- The constraints object, or null if the canonical representation is invalid.
-
-