Record Class ImageCropPreviewsComponent.ImageCropPreview

java.lang.Object
java.lang.Record
org.ametys.web.skin.ImageCropPreviewsComponent.ImageCropPreview
Record Components:
width - the crop width
height - the crop height
label - the crop label. Can be null.
includedContentTypes - the content types for which this crop preview should be included. If null, it is included for all content types
excludedContentTypes - the content types for which this crop preview should be excluded. If null, it is not excluded for any content type
Enclosing class:
ImageCropPreviewsComponent

public static record ImageCropPreviewsComponent.ImageCropPreview(int width, int height, I18nizableText label, Set<String> includedContentTypes, Set<String> excludedContentTypes) extends Record
Represents a preview for an image crop, with its dimensions, label and content types conditions
  • Constructor Details

    • ImageCropPreview

      public ImageCropPreview(int width, int height, I18nizableText label, Set<String> includedContentTypes, Set<String> excludedContentTypes)
      Creates an instance of a ImageCropPreview record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
      label - the value for the label record component
      includedContentTypes - the value for the includedContentTypes record component
      excludedContentTypes - the value for the excludedContentTypes record component
  • Method Details

    • toJson

      public Map<String,Object> toJson()
      Returns the json representation of a crop image preview
      Returns:
      the json representation
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • label

      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • includedContentTypes

      Returns the value of the includedContentTypes record component.
      Returns:
      the value of the includedContentTypes record component
    • excludedContentTypes

      Returns the value of the excludedContentTypes record component.
      Returns:
      the value of the excludedContentTypes record component