Class MutableCapabilities

  • All Implemented Interfaces:
    Capabilities

    public class MutableCapabilities
    extends java.lang.Object
    implements Capabilities
    • 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 interface Capabilities
        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 interface Capabilities
        Returns:
        The capabilities as a Map.
      • getCapability

        public java.lang.Object getCapability​(java.lang.String capabilityName)
        Specified by:
        getCapability in interface Capabilities
        Parameters:
        capabilityName - The capability to return.
        Returns:
        The value, or null if not set.
        See Also:
        org.openqa.selenium.remote.CapabilityType
      • 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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object