Enum Class OperatingSystem

java.lang.Object
java.lang.Enum<OperatingSystem>
com.luna.common.os.OperatingSystem
All Implemented Interfaces:
Serializable, Comparable<OperatingSystem>, java.lang.constant.Constable

public enum OperatingSystem extends Enum<OperatingSystem>
Enum constants for most common operating systems.
Author:
harald
  • Enum Constant Details

  • Method Details

    • values

      public static OperatingSystem[] 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 OperatingSystem 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
    • parseUserAgentString

      public static OperatingSystem parseUserAgentString(String agentString)
      Parses user agent string and returns the best match. Returns OperatingSystem.UNKNOWN if there is no match.
      Parameters:
      agentString - User-agent string as provided in the request.
      Returns:
      OperatingSystem enum
    • parseUserAgentLowercaseString

      public static OperatingSystem parseUserAgentLowercaseString(String agentString)
    • parseUserAgentString

      public static OperatingSystem parseUserAgentString(String agentString, List<OperatingSystem> operatingSystems)
      Parses the user agent string and returns the best match for the given operating systems. Returns OperatingSystem.UNKNOWN if there is no match. Be aware that if the order of the provided operating systems is incorrect or the set is too limited it can lead to false matches!
      Parameters:
      agentString - User-agent string as provided in the request.
      Returns:
      OperatingSystem enum
    • valueOf

      public static OperatingSystem valueOf(short id)
      Returns the enum constant of this type with the specified id. Throws IllegalArgumentException if the value does not exist.
      Parameters:
      id - Id value of the operating system.
      Returns:
      OperatingSystem enum
    • getId

      public short getId()
    • getName

      public String getName()
    • isMobileDevice

      @Deprecated public boolean isMobileDevice()
      Deprecated.
    • getDeviceType

      public DeviceType getDeviceType()
    • getGroup

      public OperatingSystem getGroup()
    • getManufacturer

      public Manufacturer getManufacturer()
      Returns the manufacturer of the operating system
      Returns:
      the manufacturer
    • isInUserAgentString

      public boolean isInUserAgentString(String agentString)
      Checks if the given user-agent string matches to the operating system. Only checks for one specific operating system.
      Parameters:
      agentString - User-agent string as provided in the request.
      Returns:
      boolean