java.lang.Object
de.powerstat.validation.values.ScreenSize
- All Implemented Interfaces:
IValueObject,Comparable<ScreenSize>
Screen size.
Not DSGVO relevant.
TODO min, max
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateScreenSize(int width, int height, String name) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ScreenSize obj) Compare with another object.booleanIs equal with another object.intGet screen height.getName()Get screen size name.intgetWidth()Get screen width.inthashCode()Calculate hash code.static ScreenSizeScreenSize factory.static ScreenSizeScreenSize factory.Returns the value of this ScreenSize as a string.toString()Returns the string representation of this ScreenSize.
-
Field Details
-
width
private final int widthScreen width (1-8192). -
height
private final int heightScreen height (1-8192). -
name
Screen size name.
-
-
Constructor Details
-
ScreenSize
Constructor.- Parameters:
width- Screen width in pixel (1-8192)height- Screen height in pixel (1-8192)name- Screen size name
-
-
Method Details
-
of
ScreenSize factory.- Parameters:
width- Screen width in pixel (1-8192)height- Screen height in pixel (1-8192)name- Screen size name- Returns:
- ScreenSize
-
of
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
Returns the value of this ScreenSize as a string.- Specified by:
stringValuein interfaceIValueObject- Returns:
- The text value represented by this object after conversion to type string format 320x200.
-
getName
Get screen size name.- Returns:
- Screen size name
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
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]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<ScreenSize>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-