Class MediaArgs.WidthOption

  • Enclosing class:
    MediaArgs

    @ProviderType
    public static final class MediaArgs.WidthOption
    extends java.lang.Object
    Width value with mandatory flag.
    • Constructor Detail

      • WidthOption

        public WidthOption​(long width)
        Parameters:
        width - mandatory width value
      • WidthOption

        public WidthOption​(long width,
                           @Nullable
                           @Nullable java.lang.String density)
        Parameters:
        width - mandatory width value
        density - pixel density, or null for default density (1x)
      • WidthOption

        public WidthOption​(long width,
                           boolean mandatory)
        Parameters:
        width - Width value
        mandatory - Is it mandatory to resolve a rendition with this width
      • WidthOption

        public WidthOption​(long width,
                           @Nullable
                           @Nullable java.lang.String density,
                           boolean mandatory)
        Parameters:
        width - Width value
        density - pixel density, or null for default density (1x)
        mandatory - Is it mandatory to resolve a rendition with this width
    • Method Detail

      • getWidth

        public long getWidth()
        Returns:
        Width value
      • isMandatory

        public boolean isMandatory()
        Returns:
        Is it mandatory to resolve a rendition with this width
      • getDensity

        @Nullable
        public @Nullable java.lang.String getDensity()
        Returns:
        density descriptor or null
      • getWidthDescriptor

        @NotNull
        public @NotNull java.lang.String getWidthDescriptor()
        Returns:
        width descriptor for srcset, e.g. 200w
      • getDensityDescriptor

        @NotNull
        public @NotNull java.lang.String getDensityDescriptor()
        Returns:
        density descriptor if it is not null and is not "1x", otherwise an empty string is returned
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object