Enum BrowserVersionTrait
- java.lang.Object
 - 
- java.lang.Enum<BrowserVersionTrait>
 - 
- org.openqa.selenium.htmlunit.options.BrowserVersionTrait
 
 
 
- 
- All Implemented Interfaces:
 Serializable,Comparable<BrowserVersionTrait>,BrowserVersionTraitNames,OptionEnum
public enum BrowserVersionTrait extends Enum<BrowserVersionTrait> implements BrowserVersionTraitNames, OptionEnum
- Author:
 - Scott Babcock, Ronald Brill
 
 
- 
- 
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPT_ENCODING_HEADERReturns the value used by the browser for theAccept-Encodingheader.ACCEPT_LANGUAGE_HEADERReturns the value used by the browser for theAccept-Languageheader.APPLICATION_CODE_NAMEReturns the application code name, for example "Mozilla".APPLICATION_MINOR_VERSIONReturns the application minor version, for example "0".APPLICATION_NAMEReturns the application name, for example "Microsoft Internet Explorer".APPLICATION_VERSIONReturns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".BROWSER_LANGUAGEReturns the browser language, for example "en-US".CSS_ACCEPT_HEADERReturns the value used by the browser for theAcceptheader if requesting a CSS declaration.HTML_ACCEPT_HEADERReturns the value used by the browser for theAcceptheader if requesting a page.IMG_ACCEPT_HEADERReturns the value used by the browser for theAcceptheader if requesting an image.IS_ONLINEReturnstrueif the browser is currently online.NICKNAMEReturns the nickname for the browser represented by this BrowserVersion.NUMERIC_CODEReturns the numeric code for the browser represented by this BrowserVersion.PLATFORMReturns the platform on which the application is running, for example "Win32".SCRIPT_ACCEPT_HEADERReturns the value used by the browser for theAcceptheader if requesting a script.SEC_CLIENT_HINT_USER_AGENT_HEADERReturns the value used by the browser for theSec-CH-UAheader.SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADERReturns the value used by the browser for theSec-CH-UA-Platformheader.SYSTEM_TIMEZONEReturns the systemTimeZone.USER_AGENTReturns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".VENDORReturns the browser vendor, for example "Google Inc.".XML_HTTP_REQUEST_ACCEPT_HEADERReturns the value used by the browser for theAcceptheader if performing an XMLHttpRequest. 
- 
Field Summary
- 
Fields inherited from interface org.openqa.selenium.htmlunit.options.BrowserVersionTraitNames
optAcceptEncodingHeader, optAcceptLanguageHeader, optApplicationCodeName, optApplicationMinorVersion, optApplicationName, optApplicationVersion, optBrowserLanguage, optCssAcceptHeader, optHtmlAcceptHeader, optImgAcceptHeader, optIsOnline, optNickname, optNumericCode, optPlatform, optScriptAcceptHeader, optSecClientHintUserAgentHeader, optSecClientHintUserAgentPlatformHeader, optSystemTimezone, optUserAgent, optVendor, optXmlHttpRequestAcceptHeader, SECTION 
 - 
 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Object value, BrowserVersion.BrowserVersionBuilder builder)Apply the specified value for this trait into the provided browser version builder.voidapplyPropertyTo(Map<String,Object> optionsMap)Apply the value of the system property associated with this trait to the specified options map.Objectdecode(Object value)Decode the specified value according to the type of this trait.Objectencode(Object value)Encode the specified value according to the type of this trait.static BrowserVersionTraitfromCapabilityKey(String key)static BrowserVersionTraitfromPropertyName(String name)StringgetCapabilityKey()ObjectgetDefaultValue()Class<?>getOptionType()StringgetPropertyName()booleanisDefaultValue(Object value)Determine if the specified value matches the default for this trait.Objectobtain(BrowserVersion version)Obtain the value for this trait from the specified browser version object.static BrowserVersionTraitvalueOf(String name)Returns the enum constant of this type with the specified name.static BrowserVersionTrait[]values()Returns an array containing the constants of this enum type, in the order they are declared. 
 - 
 
- 
- 
Enum Constant Detail
- 
NUMERIC_CODE
public static final BrowserVersionTrait NUMERIC_CODE
Returns the numeric code for the browser represented by this BrowserVersion.property: webdriver.htmlunit.numericCode
type:int
default:0 
- 
NICKNAME
public static final BrowserVersionTrait NICKNAME
Returns the nickname for the browser represented by this BrowserVersion.property: webdriver.htmlunit.nickname
type:String
default:null 
- 
APPLICATION_VERSION
public static final BrowserVersionTrait APPLICATION_VERSION
Returns the application version, for example "4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.applicationVersion
type:String
default:null
see: MSDN documentation 
- 
USER_AGENT
public static final BrowserVersionTrait USER_AGENT
Returns the user agent string, for example "Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)".property: webdriver.htmlunit.userAgent
type:String
default:null 
- 
APPLICATION_NAME
public static final BrowserVersionTrait APPLICATION_NAME
Returns the application name, for example "Microsoft Internet Explorer".property: webdriver.htmlunit.applicationName
type:String
default:null- See Also:
 - MSDN documentation
 
 
- 
APPLICATION_CODE_NAME
public static final BrowserVersionTrait APPLICATION_CODE_NAME
Returns the application code name, for example "Mozilla".property: webdriver.htmlunit.applicationCodeName
type:String
default: "Mozilla"
see: MSDN documentation 
- 
APPLICATION_MINOR_VERSION
public static final BrowserVersionTrait APPLICATION_MINOR_VERSION
Returns the application minor version, for example "0".property: webdriver.htmlunit.applicationMinorVersion
type:String
default: "0"
see: MSDN documentation 
- 
VENDOR
public static final BrowserVersionTrait VENDOR
Returns the browser vendor, for example "Google Inc.".property: webdriver.htmlunit.vendor
type:String
default: "" 
- 
BROWSER_LANGUAGE
public static final BrowserVersionTrait BROWSER_LANGUAGE
Returns the browser language, for example "en-US".property: webdriver.htmlunit.browserLanguage
type:String
default: "en_US" 
- 
IS_ONLINE
public static final BrowserVersionTrait IS_ONLINE
Returnstrueif the browser is currently online.property: webdriver.htmlunit.isOnline
type:boolean
default:true
see: MSDN documentation 
- 
PLATFORM
public static final BrowserVersionTrait PLATFORM
Returns the platform on which the application is running, for example "Win32".property: webdriver.htmlunit.platform
type:String
default: "Win32"
see: MSDN documentation 
- 
SYSTEM_TIMEZONE
public static final BrowserVersionTrait SYSTEM_TIMEZONE
 
- 
ACCEPT_ENCODING_HEADER
public static final BrowserVersionTrait ACCEPT_ENCODING_HEADER
Returns the value used by the browser for theAccept-Encodingheader.property: webdriver.htmlunit.acceptEncodingHeader
type:String
default:null 
- 
ACCEPT_LANGUAGE_HEADER
public static final BrowserVersionTrait ACCEPT_LANGUAGE_HEADER
Returns the value used by the browser for theAccept-Languageheader.property: webdriver.htmlunit.acceptLanguageHeader
type:String
default:null 
- 
HTML_ACCEPT_HEADER
public static final BrowserVersionTrait HTML_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a page.property: webdriver.htmlunit.htmlAcceptHeader
type:String
default:null 
- 
IMG_ACCEPT_HEADER
public static final BrowserVersionTrait IMG_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting an image.property: webdriver.htmlunit.imgAcceptHeader
type:String
default:null 
- 
CSS_ACCEPT_HEADER
public static final BrowserVersionTrait CSS_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a CSS declaration.property: webdriver.htmlunit.cssAcceptHeader
type:String
default:null 
- 
SCRIPT_ACCEPT_HEADER
public static final BrowserVersionTrait SCRIPT_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if requesting a script.property: webdriver.htmlunit.scriptAcceptHeader
type:String
default:null 
- 
XML_HTTP_REQUEST_ACCEPT_HEADER
public static final BrowserVersionTrait XML_HTTP_REQUEST_ACCEPT_HEADER
Returns the value used by the browser for theAcceptheader if performing an XMLHttpRequest.property: webdriver.htmlunit.xmlHttpRequestAcceptHeader
type:String
default:null 
- 
SEC_CLIENT_HINT_USER_AGENT_HEADER
public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_HEADER
Returns the value used by the browser for theSec-CH-UAheader.property: webdriver.htmlunit.secClientHintUserAgentHeader
type:String
default:null 
- 
SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
public static final BrowserVersionTrait SEC_CLIENT_HINT_USER_AGENT_PLATFORM_HEADER
Returns the value used by the browser for theSec-CH-UA-Platformheader.property: webdriver.htmlunit.secClientHintUserAgentPlatformHeader
type:String
default:null 
 - 
 
- 
Method Detail
- 
values
public static BrowserVersionTrait[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BrowserVersionTrait c : BrowserVersionTrait.values()) System.out.println(c);
- Returns:
 - an array containing the constants of this enum type, in the order they are declared
 
 
- 
valueOf
public static BrowserVersionTrait valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
 
- 
getCapabilityKey
public String getCapabilityKey()
- Specified by:
 getCapabilityKeyin interfaceOptionEnum
 
- 
getPropertyName
public String getPropertyName()
- Specified by:
 getPropertyNamein interfaceOptionEnum
 
- 
getOptionType
public Class<?> getOptionType()
- Specified by:
 getOptionTypein interfaceOptionEnum
 
- 
getDefaultValue
public Object getDefaultValue()
- Specified by:
 getDefaultValuein interfaceOptionEnum
 
- 
isDefaultValue
public boolean isDefaultValue(Object value)
Determine if the specified value matches the default for this trait.- Specified by:
 isDefaultValuein interfaceOptionEnum- Parameters:
 value- value to be evaluated- Returns:
 trueif specified value matches the default value; otherwisefalse
 
- 
applyPropertyTo
public void applyPropertyTo(Map<String,Object> optionsMap)
Apply the value of the system property associated with this trait to the specified options map.- Specified by:
 applyPropertyToin interfaceOptionEnum- Parameters:
 optionsMap- browser version options map
 
- 
encode
public Object encode(Object value)
Encode the specified value according to the type of this trait.- Specified by:
 encodein interfaceOptionEnum- Parameters:
 value- value to be encoded- Returns:
 - trait-specific encoding for specified value
 
 
- 
decode
public Object decode(Object value)
Decode the specified value according to the type of this trait.- Specified by:
 decodein interfaceOptionEnum- Parameters:
 value- value to be decoded- Returns:
 - trait-specific decoding for specified value
 
 
- 
apply
public void apply(Object value, BrowserVersion.BrowserVersionBuilder builder)
Apply the specified value for this trait into the provided browser version builder.- Parameters:
 value- value to be insertedbuilder-BrowserVersion.BrowserVersionBuilderobject
 
- 
obtain
public Object obtain(BrowserVersion version)
Obtain the value for this trait from the specified browser version object.- Parameters:
 version-BrowserVersionobject- Returns:
 - value for this trait
 
 
- 
fromCapabilityKey
public static BrowserVersionTrait fromCapabilityKey(String key)
 
- 
fromPropertyName
public static BrowserVersionTrait fromPropertyName(String name)
 
 - 
 
 -