本文整理了Java中eu.bitwalker.useragentutils.Browser.getId()
方法的一些代码示例,展示了Browser.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Browser.getId()
方法的具体详情如下:
包路径:eu.bitwalker.useragentutils.Browser
类名称:Browser
方法名:getId
暂无
代码示例来源:origin: HaraldWalker/user-agent-utils
public UserAgent(OperatingSystem operatingSystem, Browser browser)
{
this.operatingSystem = operatingSystem;
this.browser = browser;
this.id = (( operatingSystem.getId() << 16) + browser.getId());
}
代码示例来源:origin: HaraldWalker/user-agent-utils
/**
* Returns the enum constant of this type with the specified id.
* Throws IllegalArgumentException if the value does not exist.
* @param id Id of the browser
* @return Browser enum
*/
public static Browser valueOf(short id)
{
for (Browser browser : Browser.values())
{
if (browser.getId() == id)
return browser;
}
// same behavior as standard valueOf(string) method
throw new IllegalArgumentException(
"No enum const for id " + id);
}
代码示例来源:origin: HaraldWalker/user-agent-utils
public UserAgent(String userAgentString)
{
String userAgentLowercaseString = userAgentString == null ? null : userAgentString.toLowerCase();
Browser browser = Browser.parseUserAgentLowercaseString(userAgentLowercaseString);
OperatingSystem operatingSystem = OperatingSystem.UNKNOWN;
// BOTs don't have an interesting OS for us
if (browser != Browser.BOT)
operatingSystem = OperatingSystem.parseUserAgentLowercaseString(userAgentLowercaseString);
this.operatingSystem = operatingSystem;
this.browser = browser;
this.id = ((operatingSystem.getId() << 16) + browser.getId());
this.userAgentString = userAgentString;
}
代码示例来源:origin: eu.bitwalker/UserAgentUtils
public UserAgent(OperatingSystem operatingSystem, Browser browser)
{
this.operatingSystem = operatingSystem;
this.browser = browser;
this.id = (( operatingSystem.getId() << 16) + browser.getId());
}
代码示例来源:origin: eu.bitwalker/UserAgentUtils
/**
* Returns the enum constant of this type with the specified id.
* Throws IllegalArgumentException if the value does not exist.
* @param id Id of the browser
* @return Browser enum
*/
public static Browser valueOf(short id)
{
for (Browser browser : Browser.values())
{
if (browser.getId() == id)
return browser;
}
// same behavior as standard valueOf(string) method
throw new IllegalArgumentException(
"No enum const for id " + id);
}
代码示例来源:origin: eu.bitwalker/UserAgentUtils
public UserAgent(String userAgentString)
{
String userAgentLowercaseString = userAgentString == null ? null : userAgentString.toLowerCase();
Browser browser = Browser.parseUserAgentLowercaseString(userAgentLowercaseString);
OperatingSystem operatingSystem = OperatingSystem.UNKNOWN;
// BOTs don't have an interesting OS for us
if (browser != Browser.BOT)
operatingSystem = OperatingSystem.parseUserAgentLowercaseString(userAgentLowercaseString);
this.operatingSystem = operatingSystem;
this.browser = browser;
this.id = ((operatingSystem.getId() << 16) + browser.getId());
this.userAgentString = userAgentString;
}
代码示例来源:origin: stackoverflow.com
public class BrowserTest{
@Test
public void testNoArgsConstructor(){
Browser testedBrowser = new Browser();
assertNull(testedBrowser.getWineCase());
assertNull(testedBrowser.getWebsite());
assertEquals(00065, testedBrowser.getId());
assertEquals(1992, testedBrowser.getYearOfBirth());
assertTrue(testedBrowser.getMemberId());
assertFalse(testedBrowser.isDiscount());
}
//more tests
}
内容来源于网络,如有侵权,请联系作者删除!