Record Class PWAScreenshots.Shot

java.lang.Object
java.lang.Record
com.iizix.pwa.PWAScreenshots.Shot
Record Components:
name - The file name in the screenshots directory, e.g. home-phone.png.
data - The file's bytes.
width - The width in pixels.
height - The height in pixels.
mediaType - image/png or image/jpeg.
formFactor - PWAScreenshots.NARROW or PWAScreenshots.WIDE.
Enclosing class:
PWAScreenshots

public static record PWAScreenshots.Shot(String name, byte[] data, int width, int height, String mediaType, String formFactor) extends Record
One screenshot.
Author:
Christopher Mindus
  • Constructor Details

    • Shot

      public Shot(String name, byte[] data, int width, int height, String mediaType, String formFactor)
      Creates an instance of a Shot record class.
      Parameters:
      name - the value for the name record component
      data - the value for the data record component
      width - the value for the width record component
      height - the value for the height record component
      mediaType - the value for the mediaType record component
      formFactor - the value for the formFactor record component
  • Method Details

    • servedName

      public String servedName()
      Gets the served name under the application directory.
      Returns:
      screenshots/<name>.
    • sizes

      public String sizes()
      Gets the manifest's sizes value.
      Returns:
      <width>x<height>.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • data

      public byte[] data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • 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
    • mediaType

      public String mediaType()
      Returns the value of the mediaType record component.
      Returns:
      the value of the mediaType record component
    • formFactor

      public String formFactor()
      Returns the value of the formFactor record component.
      Returns:
      the value of the formFactor record component