Enum Class OperatingSystem

java.lang.Object
java.lang.Enum<OperatingSystem>
com.luna.common.os.OperatingSystem
所有已实现的接口:
Serializable, Comparable<OperatingSystem>, java.lang.constant.Constable

public enum OperatingSystem extends Enum<OperatingSystem>
Enum constants for most common operating systems.
作者:
harald
  • 枚举常量详细资料

  • 方法详细资料

    • values

      public static OperatingSystem[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      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.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值
    • parseUserAgentString

      public static OperatingSystem parseUserAgentString(String agentString)
      Parses user agent string and returns the best match. Returns OperatingSystem.UNKNOWN if there is no match.
      参数:
      agentString - User-agent string as provided in the request.
      返回:
      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!
      参数:
      agentString - User-agent string as provided in the request.
      返回:
      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.
      参数:
      id - Id value of the operating system.
      返回:
      OperatingSystem enum
    • getId

      public short getId()
    • getName

      public String getName()
    • isMobileDevice

      @Deprecated public boolean isMobileDevice()
      已过时。
    • getDeviceType

      public DeviceType getDeviceType()
    • getGroup

      public OperatingSystem getGroup()
    • getManufacturer

      public Manufacturer getManufacturer()
      Returns the manufacturer of the operating system
      返回:
      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.
      参数:
      agentString - User-agent string as provided in the request.
      返回:
      boolean