Interface OptionEnum
-
- All Known Implementing Classes:
BrowserVersionTrait,HtmlUnitOption
public interface OptionEnumRepresents an enumerated option that can be configured on a driver. Provides methods to access the option's key, property name, type, default value, and to apply, encode, or decode its value.- Author:
- Scott Babcock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyPropertyTo(Map<String,Object> optionsMap)Applies this option's value to the given options map.Objectdecode(Object value)Decodes a value from its stored or transmitted form back into the option's native type.Objectencode(Object value)Encodes a value into a format suitable for storing or sending to the driver.StringgetCapabilityKey()Returns the capability key associated with this option.ObjectgetDefaultValue()Returns the default value of this option.Class<?>getOptionType()Returns the expected type of this option's value.StringgetPropertyName()Returns the property name for this option.booleanisDefaultValue(Object value)Determines if the given value matches this option's default value.
-
-
-
Method Detail
-
getCapabilityKey
String getCapabilityKey()
Returns the capability key associated with this option.- Returns:
- the capability key
-
getPropertyName
String getPropertyName()
Returns the property name for this option.- Returns:
- the property name
-
getOptionType
Class<?> getOptionType()
Returns the expected type of this option's value.- Returns:
- the option type
-
getDefaultValue
Object getDefaultValue()
Returns the default value of this option.- Returns:
- the default value
-
isDefaultValue
boolean isDefaultValue(Object value)
Determines if the given value matches this option's default value.- Parameters:
value- the value to check- Returns:
trueif the value is the default;falseotherwise
-
applyPropertyTo
void applyPropertyTo(Map<String,Object> optionsMap)
Applies this option's value to the given options map.- Parameters:
optionsMap- the map of options to update
-
encode
Object encode(Object value)
Encodes a value into a format suitable for storing or sending to the driver.- Parameters:
value- the value to encode- Returns:
- the encoded value
-
-