Class DefaultDriverHandler

  • All Implemented Interfaces:
    DriverHandler

    public class DefaultDriverHandler
    extends java.lang.Object
    implements DriverHandler
    Default implementation of driver handler.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultDriverHandler​(DriverData data)
      Creates new driver handler with the attached driver data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends Behaviour>
      T
      behaviour​(java.lang.Class<T> behaviourClass)
      Returns the specified facet of behaviour to interact with the device.
      DriverData data()
      Returns the device driver data.
      Driver driver()
      Returns the parent device driver.
      <T> T get​(java.lang.Class<T> serviceClass)
      Returns the reference to the implementation of the specified service.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultDriverHandler

        public DefaultDriverHandler​(DriverData data)
        Creates new driver handler with the attached driver data.
        Parameters:
        data - driver data to attach
    • Method Detail

      • driver

        public Driver driver()
        Description copied from interface: DriverHandler
        Returns the parent device driver.
        Specified by:
        driver in interface DriverHandler
        Returns:
        device driver
      • behaviour

        public <T extends Behaviour> T behaviour​(java.lang.Class<T> behaviourClass)
        Description copied from interface: DriverHandler
        Returns the specified facet of behaviour to interact with the device.
        Specified by:
        behaviour in interface DriverHandler
        Type Parameters:
        T - type of behaviour
        Parameters:
        behaviourClass - behaviour class
        Returns:
        behaviour
      • get

        public <T> T get​(java.lang.Class<T> serviceClass)
        Description copied from interface: DriverHandler
        Returns the reference to the implementation of the specified service. Provides access to run-time context.
        Specified by:
        get in interface DriverHandler
        Type Parameters:
        T - type of service
        Parameters:
        serviceClass - service class
        Returns:
        service implementation
      • toString

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