Class ImageThumbnailGeneratorConstraints
java.lang.Object
de.xima.fc.common.image.ImageThumbnailGeneratorConstraints
- All Implemented Interfaces:
Serializable
Constraints for generating image thumbnails, see
IImageThumbnailGenerator.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forImageThumbnailGeneratorConstraints. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder forImageThumbnailGeneratorConstraints.booleaninthashCode()none()Gets aImageThumbnailGeneratorConstraintsobject with no constraints.ofCanonicalRepresentation(String canonicalRepresentation) Parses acanonical representationof constraints into aImageThumbnailGeneratorConstraintsobject.ofCanonicalRepresentationOrNull(String canonicalRepresentation) Parses acanonical representationof constraints into aImageThumbnailGeneratorConstraintsobject.Gets the constraint on the target height for the thumbnail.Gets the constraint on the target width for the thumbnail.Gets the canonical string representation of this constraints set.toString()
-
Method Details
-
equals
-
hashCode
-
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
Gets the constraint on the target width for the thumbnail.- Returns:
- The target width in pixels, or null if no constraint is set.
-
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.
-
toString
-
builder
Creates a new builder forImageThumbnailGeneratorConstraints.- Returns:
- The new builder.
-
none
Gets aImageThumbnailGeneratorConstraintsobject with no constraints.- Returns:
- An object representing no constraints.
-
ofCanonicalRepresentation
public static ImageThumbnailGeneratorConstraints ofCanonicalRepresentation(String canonicalRepresentation) Parses acanonical representationof constraints into aImageThumbnailGeneratorConstraintsobject.- 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 representationof constraints into aImageThumbnailGeneratorConstraintsobject.- Parameters:
canonicalRepresentation- The canonical representation.- Returns:
- The constraints object, or null if the canonical representation is invalid.
-