Class MediaFormatBuilder


  • @ProviderType
    public final class MediaFormatBuilder
    extends java.lang.Object
    Fluent API for building media format definitions.
    • Method Detail

      • create

        @NotNull
        public static @NotNull MediaFormatBuilder create​(@NotNull
                                                         @NotNull java.lang.String name)
        Create a new media format builder.
        Parameters:
        name - Media format name. Only characters, numbers, hyphen and underline are allowed.
        Returns:
        Media format builder
      • label

        @NotNull
        public @NotNull MediaFormatBuilder label​(java.lang.String value)
        Parameters:
        value - Label for displaying to user
        Returns:
        this
      • description

        @NotNull
        public @NotNull MediaFormatBuilder description​(java.lang.String value)
        Parameters:
        value - Description for displaying to user
        Returns:
        this
      • width

        @NotNull
        public @NotNull MediaFormatBuilder width​(long value)
        Parameters:
        value - Fixed image width (px)
        Returns:
        this
      • minWidth

        @NotNull
        public @NotNull MediaFormatBuilder minWidth​(long value)
        Parameters:
        value - Image width min (px)
        Returns:
        this
      • maxWidth

        @NotNull
        public @NotNull MediaFormatBuilder maxWidth​(long value)
        Parameters:
        value - Image width max (px)
        Returns:
        this
      • width

        @NotNull
        public @NotNull MediaFormatBuilder width​(long min,
                                                 long max)
        Parameters:
        min - Image width min (px)
        max - Image width max (px)
        Returns:
        this
      • height

        @NotNull
        public @NotNull MediaFormatBuilder height​(long value)
        Parameters:
        value - Fixed image height (px)
        Returns:
        this
      • minHeight

        @NotNull
        public @NotNull MediaFormatBuilder minHeight​(long value)
        Parameters:
        value - Image height min (px)
        Returns:
        this
      • maxHeight

        @NotNull
        public @NotNull MediaFormatBuilder maxHeight​(long value)
        Parameters:
        value - Image height max (px)
        Returns:
        this
      • height

        @NotNull
        public @NotNull MediaFormatBuilder height​(long min,
                                                  long max)
        Parameters:
        min - Image height min (px)
        max - Image height max (px)
        Returns:
        this
      • minWidthHeight

        @NotNull
        public @NotNull MediaFormatBuilder minWidthHeight​(long value)
        Parameters:
        value - Min. width/height (px) - the longest edge is checked. Cannot be combined with other width/height restrictions.
        Returns:
        this
      • fixedDimension

        @NotNull
        public @NotNull MediaFormatBuilder fixedDimension​(long widthValue,
                                                          long heightValue)
        Parameters:
        widthValue - Fixed image width (px)
        heightValue - Fixed image height (px)
        Returns:
        this
      • ratio

        @NotNull
        public @NotNull MediaFormatBuilder ratio​(double value)
        Parameters:
        value - Ratio (width/height)
        Returns:
        this
      • ratio

        @NotNull
        public @NotNull MediaFormatBuilder ratio​(long widthValue,
                                                 long heightValue)
        Parameters:
        widthValue - Ratio width sample value (is used for calculating the ratio together with ratioHeight, and for display)
        heightValue - Ratio height sample value (is used for calculating the ratio together with ratioWidth, and for display)
        Returns:
        this
      • ratio

        @NotNull
        public @NotNull MediaFormatBuilder ratio​(double widthValue,
                                                 double heightValue)
        Parameters:
        widthValue - Ratio width sample value (is used for calculating the ratio together with ratioHeight, and for display)
        heightValue - Ratio height sample value (is used for calculating the ratio together with ratioWidth, and for display)
        Returns:
        this
      • fileSizeMax

        @NotNull
        public @NotNull MediaFormatBuilder fileSizeMax​(long value)
        Parameters:
        value - Max. file size (bytes)
        Returns:
        this
      • extensions

        @NotNull
        public @NotNull MediaFormatBuilder extensions​(java.lang.String... value)
        Parameters:
        value - Allowed file extensions
        Returns:
        this
      • renditionGroup

        @NotNull
        public @NotNull MediaFormatBuilder renditionGroup​(java.lang.String value)
        Parameters:
        value - Rendition group id
        Returns:
        this
      • download

        @NotNull
        public @NotNull MediaFormatBuilder download​(boolean value)
        Parameters:
        value - Media assets with this format should be downloaded and not displayed directly
        Returns:
        this
      • internal

        @NotNull
        public @NotNull MediaFormatBuilder internal​(boolean value)
        Parameters:
        value - For internal use only (not displayed for user)
        Returns:
        this
      • ranking

        @NotNull
        public @NotNull MediaFormatBuilder ranking​(int value)
        Parameters:
        value - Ranking for controlling priority in auto-detection. Lowest value = highest priority.
        Returns:
        this
      • properties

        @NotNull
        public @NotNull MediaFormatBuilder properties​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Custom properties that my be used by application-specific markup builders or processors.
        Parameters:
        map - Property map. Is merged with properties already set in builder.
        Returns:
        this
      • property

        @NotNull
        public @NotNull MediaFormatBuilder property​(java.lang.String key,
                                                    java.lang.Object value)
        Custom properties that my be used by application-specific markup builders or processors.
        Parameters:
        key - Property key
        value - Property value
        Returns:
        this
      • build

        @NotNull
        public @NotNull MediaFormat build()
        Builds the media format definition.
        Returns:
        Media format definition