Record Class ScreenOrientationData
java.lang.Object
java.lang.Record
com.vaadin.flow.component.screenorientation.ScreenOrientationData
- Record Components:
type- the screen orientation type; nevernullangle- how far the screen is rotated from its natural orientation, clockwise in degrees (typically0,90,180, or270). The natural orientation is device-dependent: on a phone it is usually portrait, on many tablets and desktops landscape, so the same angle can mean different orientations on different devices ? usetype()to reason about the orientation itself.
- All Implemented Interfaces:
Serializable
public record ScreenOrientationData(ScreenOrientationType type, int angle)
extends Record
implements Serializable
The current screen orientation, as reported by
ScreenOrientation.orientationSignal(): both its
type (portrait or landscape, primary or
secondary) and its rotation angle.- Since:
- 25.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionScreenOrientationData(ScreenOrientationType type, int angle) Creates an instance of aScreenOrientationDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionintangle()Returns the value of theanglerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
angle
public int angle()Returns the value of theanglerecord component.- Returns:
- the value of the
anglerecord component
-