Package org.openqa.selenium
Class MutableCapabilities
- java.lang.Object
-
- org.openqa.selenium.MutableCapabilities
-
- All Implemented Interfaces:
Capabilities
public class MutableCapabilities extends java.lang.Object implements Capabilities
-
-
Constructor Summary
Constructors Constructor Description MutableCapabilities()
MutableCapabilities(java.util.Map<java.lang.String,?> capabilities)
MutableCapabilities(Capabilities other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
amendHashCode()
Subclasses can use this to add information that isn't always in the capabilities map.java.util.Map<java.lang.String,java.lang.Object>
asMap()
boolean
equals(java.lang.Object o)
java.lang.Object
getCapability(java.lang.String capabilityName)
java.util.Set<java.lang.String>
getCapabilityNames()
int
hashCode()
MutableCapabilities
merge(Capabilities extraCapabilities)
Merge the extra capabilities provided into this DesiredCapabilities instance.void
setCapability(java.lang.String capabilityName, boolean value)
void
setCapability(java.lang.String key, java.lang.Object value)
void
setCapability(java.lang.String capabilityName, java.lang.String value)
void
setCapability(java.lang.String capabilityName, Platform value)
java.util.Map<java.lang.String,java.lang.Object>
toJson()
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openqa.selenium.Capabilities
getBrowserName, getPlatform, getVersion, is
-
-
-
-
Constructor Detail
-
MutableCapabilities
public MutableCapabilities()
-
MutableCapabilities
public MutableCapabilities(Capabilities other)
-
MutableCapabilities
public MutableCapabilities(java.util.Map<java.lang.String,?> capabilities)
-
-
Method Detail
-
merge
public MutableCapabilities merge(Capabilities extraCapabilities)
Merge the extra capabilities provided into this DesiredCapabilities instance. If capabilities with the same name exist in this instance, they will be overridden by the values from the extraCapabilities object.- Specified by:
merge
in interfaceCapabilities
- Parameters:
extraCapabilities
- Additional capabilities to be added.- Returns:
- The DesiredCapabilities instance after the merge.
-
setCapability
public void setCapability(java.lang.String capabilityName, boolean value)
-
setCapability
public void setCapability(java.lang.String capabilityName, java.lang.String value)
-
setCapability
public void setCapability(java.lang.String capabilityName, Platform value)
-
setCapability
public void setCapability(java.lang.String key, java.lang.Object value)
-
asMap
public java.util.Map<java.lang.String,java.lang.Object> asMap()
- Specified by:
asMap
in interfaceCapabilities
- Returns:
- The capabilities as a Map.
-
getCapability
public java.lang.Object getCapability(java.lang.String capabilityName)
- Specified by:
getCapability
in interfaceCapabilities
- Parameters:
capabilityName
- The capability to return.- Returns:
- The value, or null if not set.
- See Also:
org.openqa.selenium.remote.CapabilityType
-
getCapabilityNames
public java.util.Set<java.lang.String> getCapabilityNames()
- Specified by:
getCapabilityNames
in interfaceCapabilities
-
toJson
public java.util.Map<java.lang.String,java.lang.Object> toJson()
-
amendHashCode
protected int amendHashCode()
Subclasses can use this to add information that isn't always in the capabilities map.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-