Class SourceSet.ImageSource

  • Enclosing class:
    SourceSet

    public static final class SourceSet.ImageSource
    extends java.lang.Object
    Represent an image source. See https://html.spec.whatwg.org/#image-source
    • Field Summary

      Fields 
      Modifier and Type Field Description
      com.google.common.base.Optional<java.lang.Float> density  
      java.lang.String url  
      com.google.common.base.Optional<java.lang.Integer> width  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ImageSource​(java.lang.String url, com.google.common.base.Optional<java.lang.Integer> width, com.google.common.base.Optional<java.lang.Float> density)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SourceSet.ImageSource create​(java.lang.String url, int width, float density)
      Returns a new image source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • url

        public final java.lang.String url
      • width

        public final com.google.common.base.Optional<java.lang.Integer> width
      • density

        public final com.google.common.base.Optional<java.lang.Float> density
    • Constructor Detail

      • ImageSource

        private ImageSource​(java.lang.String url,
                            com.google.common.base.Optional<java.lang.Integer> width,
                            com.google.common.base.Optional<java.lang.Float> density)
    • Method Detail

      • create

        public static SourceSet.ImageSource create​(java.lang.String url,
                                                   int width,
                                                   float density)
        Returns a new image source.
        Parameters:
        url - the source URL, must not be null or empty.
        width - a width descriptor, will be absent if null or negative
        density - a density descriptor, will be absent if null or negative
        Returns:
        a new image source