Enum Class ScreenOrientation

java.lang.Object
java.lang.Enum<ScreenOrientation>
com.vaadin.flow.component.page.ScreenOrientation
All Implemented Interfaces:
Serializable, Comparable<ScreenOrientation>, Constable

public enum ScreenOrientation extends Enum<ScreenOrientation>
Represents the orientation types reported by the Screen Orientation API.

These correspond to the concrete orientation types that can be observed as the current screen orientation state.

Author:
Vaadin Ltd
  • Enum Constant Details

  • Method Details

    • values

      public static ScreenOrientation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ScreenOrientation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getClientValue

      public String getClientValue()
      Returns the value as used by the browser's Screen Orientation API.
      Returns:
      the client-side orientation type string
    • fromClientValue

      public static ScreenOrientation fromClientValue(String clientValue)
      Converts a client-side orientation type string to the corresponding enum value.
      Parameters:
      clientValue - the orientation type string from the browser
      Returns:
      the corresponding enum value
      Throws:
      IllegalArgumentException - if the value does not match any known orientation type