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
ConstructorsModifierConstructorDescriptionprivate
ScreenSize
(int width, int height, String name) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ScreenSize obj) Compare with another object.boolean
Is equal with another object.int
Get screen height.getName()
Get screen size name.int
getWidth()
Get screen width.int
hashCode()
Calculate hash code.static ScreenSize
ScreenSize factory.static ScreenSize
ScreenSize 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:
stringValue
in 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:
compareTo
in interfaceComparable<ScreenSize>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-