Class ScreenSize

java.lang.Object
de.powerstat.validation.values.ScreenSize
All Implemented Interfaces:
IValueObject, Comparable<ScreenSize>

public final class ScreenSize extends Object implements Comparable<ScreenSize>, IValueObject
Screen size. Not DSGVO relevant. TODO min, max
  • Field Details

    • width

      private final int width
      Screen width (1-8192).
    • height

      private final int height
      Screen height (1-8192).
    • name

      private final String name
      Screen size name.
  • Constructor Details

    • ScreenSize

      private ScreenSize(int width, int height, String name)
      Constructor.
      Parameters:
      width - Screen width in pixel (1-8192)
      height - Screen height in pixel (1-8192)
      name - Screen size name
  • Method Details

    • of

      public static ScreenSize of(int width, int height, String name)
      ScreenSize factory.
      Parameters:
      width - Screen width in pixel (1-8192)
      height - Screen height in pixel (1-8192)
      name - Screen size name
      Returns:
      ScreenSize
    • of

      public static ScreenSize of(String value)
      ScreenSize factory.
      Parameters:
      value - width (1-8192) x height (1-8192)
      Returns:
      ScreenSize
    • getWidth

      public int getWidth()
      Get screen width.
      Returns:
      Screen width in pixel
    • getHeight

      public int getHeight()
      Get screen height.
      Returns:
      Screen height in pixel
    • stringValue

      public String stringValue()
      Returns the value of this ScreenSize as a string.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The text value represented by this object after conversion to type string format 320x200.
    • getName

      public String getName()
      Get screen size name.
      Returns:
      Screen size name
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this ScreenSize. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "ScreenSize[width=320, height=200, name=QVGA]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this ScreenSize
      See Also:
    • compareTo

      public int compareTo(ScreenSize obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<ScreenSize>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also: