@Test(expected = IllegalNullArgumentException.class) public void parseOperatingSystemVersion_userAgentString_null() { VersionParser.parseOperatingSystemVersion(OperatingSystemFamily.UNKNOWN, null); }
public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) { Check.notNull(family, "family"); Check.notNull(userAgent, "userAgent"); final VersionNumber v; if (OperatingSystemFamily.ANDROID == family) { v = identifyAndroidVersion(userAgent); } else if (OperatingSystemFamily.BADA == family) { v = identifyBadaVersion(userAgent); } else if (OperatingSystemFamily.BSD == family) { v = identifyBSDVersion(userAgent); } else if (OperatingSystemFamily.IOS == family) { v = identifyIOSVersion(userAgent); } else if (OperatingSystemFamily.JVM == family) { v = identifyJavaVersion(userAgent); } else if (OperatingSystemFamily.OS_X == family) { v = identifyOSXVersion(userAgent); } else if (OperatingSystemFamily.SYMBIAN == family) { v = identifySymbianVersion(userAgent); } else if (OperatingSystemFamily.WEBOS == family) { v = identifyWebOSVersion(userAgent); } else if (OperatingSystemFamily.WINDOWS == family) { v = identifyWindowsVersion(userAgent); } else { v = VersionNumber.UNKNOWN; } return v; }
VersionParser { public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) { Check.notNull(family, "family"); Check.notNull(userAgent, "userAgent"); final VersionNumber v; if (OperatingSystemFamily.ANDROID == family) { v = identifyAndroidVersion(userAgent); } else if (OperatingSystemFamily.BADA == family) { v = identifyBadaVersion(userAgent); } else if (OperatingSystemFamily.BSD == family) { v = identifyBSDVersion(userAgent); } else if (OperatingSystemFamily.IOS == family) { v = identifyIOSVersion(userAgent); } else if (OperatingSystemFamily.JVM == family) { v = identifyJavaVersion(userAgent); } else if (OperatingSystemFamily.OS_X == family) { v = identifyOSXVersion(userAgent); } else if (OperatingSystemFamily.SYMBIAN == family) { v = identifySymbianVersion(userAgent); } else if (OperatingSystemFamily.WEBOS == family) { v = identifyWebOSVersion(userAgent); } else if (OperatingSystemFamily.WINDOWS == family) { v = identifyWindowsVersion(userAgent); } else { v = VersionNumber.UNKNOWN; } return v; } }
VersionParser { public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) { Check.notNull(family, "family"); Check.notNull(userAgent, "userAgent"); final VersionNumber v; if (OperatingSystemFamily.ANDROID == family) { v = identifyAndroidVersion(userAgent); } else if (OperatingSystemFamily.BADA == family) { v = identifyBadaVersion(userAgent); } else if (OperatingSystemFamily.BSD == family) { v = identifyBSDVersion(userAgent); } else if (OperatingSystemFamily.IOS == family) { v = identifyIOSVersion(userAgent); } else if (OperatingSystemFamily.JVM == family) { v = identifyJavaVersion(userAgent); } else if (OperatingSystemFamily.OS_X == family) { v = identifyOSXVersion(userAgent); } else if (OperatingSystemFamily.SYMBIAN == family) { v = identifySymbianVersion(userAgent); } else if (OperatingSystemFamily.WEBOS == family) { v = identifyWebOSVersion(userAgent); } else if (OperatingSystemFamily.WINDOWS == family) { v = identifyWindowsVersion(userAgent); } else { v = VersionNumber.UNKNOWN; } return v; } private  VersionParser(); }
VersionParser { public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) { Check.notNull(family, "family"); Check.notNull(userAgent, "userAgent"); final VersionNumber v; if (OperatingSystemFamily.ANDROID == family) { v = identifyAndroidVersion(userAgent); } else if (OperatingSystemFamily.BADA == family) { v = identifyBadaVersion(userAgent); } else if (OperatingSystemFamily.BSD == family) { v = identifyBSDVersion(userAgent); } else if (OperatingSystemFamily.IOS == family) { v = identifyIOSVersion(userAgent); } else if (OperatingSystemFamily.JVM == family) { v = identifyJavaVersion(userAgent); } else if (OperatingSystemFamily.OS_X == family) { v = identifyOSXVersion(userAgent); } else if (OperatingSystemFamily.SYMBIAN == family) { v = identifySymbianVersion(userAgent); } else if (OperatingSystemFamily.WEBOS == family) { v = identifyWebOSVersion(userAgent); } else if (OperatingSystemFamily.WINDOWS == family) { v = identifyWindowsVersion(userAgent); } else { v = VersionNumber.UNKNOWN; } return v; } private  VersionParser(); static VersionNumber parseLastVersionNumber(@Nonnull final String text); static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent); static VersionNumber parseVersion(@Nonnull final String version); }
VersionParser { public static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent) { Check.notNull(family, "family"); Check.notNull(userAgent, "userAgent"); final VersionNumber v; if (OperatingSystemFamily.ANDROID == family) { v = identifyAndroidVersion(userAgent); } else if (OperatingSystemFamily.BADA == family) { v = identifyBadaVersion(userAgent); } else if (OperatingSystemFamily.BSD == family) { v = identifyBSDVersion(userAgent); } else if (OperatingSystemFamily.IOS == family) { v = identifyIOSVersion(userAgent); } else if (OperatingSystemFamily.JVM == family) { v = identifyJavaVersion(userAgent); } else if (OperatingSystemFamily.OS_X == family) { v = identifyOSXVersion(userAgent); } else if (OperatingSystemFamily.SYMBIAN == family) { v = identifySymbianVersion(userAgent); } else if (OperatingSystemFamily.WEBOS == family) { v = identifyWebOSVersion(userAgent); } else if (OperatingSystemFamily.WINDOWS == family) { v = identifyWindowsVersion(userAgent); } else { v = VersionNumber.UNKNOWN; } return v; } private  VersionParser(); static VersionNumber parseLastVersionNumber(@Nonnull final String text); static VersionNumber parseOperatingSystemVersion(@Nonnull final OperatingSystemFamily family, @Nonnull final String userAgent); static VersionNumber parseVersion(@Nonnull final String version);  }