Package io.wcm.handler.media
Class MediaArgs.WidthOption
- java.lang.Object
-
- io.wcm.handler.media.MediaArgs.WidthOption
-
- Enclosing class:
- MediaArgs
@ProviderType public static final class MediaArgs.WidthOption extends java.lang.Object
Width value with mandatory flag.
-
-
Constructor Summary
Constructors Constructor Description WidthOption(long width)
WidthOption(long width, boolean mandatory)
WidthOption(long width, @Nullable java.lang.String density)
WidthOption(long width, @Nullable java.lang.String density, boolean mandatory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
@Nullable java.lang.String
getDensity()
@NotNull java.lang.String
getDensityDescriptor()
long
getWidth()
@NotNull java.lang.String
getWidthDescriptor()
int
hashCode()
boolean
isMandatory()
java.lang.String
toString()
-
-
-
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 valuedensity
- pixel density, or null for default density (1x)
-
WidthOption
public WidthOption(long width, boolean mandatory)
- Parameters:
width
- Width valuemandatory
- 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 valuedensity
- 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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-